SQL vs. NoSQL

In the world of databases, there are two main types of solutions: SQL and NoSQL (or relational databases and non-relational databases). Both of them differ in the way they were built, the kind of information they store, and the storage method they use. Relational databases are structured and have predefined schemas like phone books that …

Consistent Hashing

Background While designing a scalable system, the most important aspect is defining how the data will be partitioned and replicated across servers. Let’s first define these terms before moving on: Data partitioning: It is the process of distributing data across a set of servers. It improves the scalability and performance of the system. Data replication: It is …

Intro to System Design

I read found an excellent article about System Design in Educative.io. Now I want to make notes on some important points for me to review later. What is System Design System design is the process of defining the architecture, interfaces, and data for a system that satisfies specific requirements. System design meets the needs of …

Spring – AOP

Aspect Oriented Programming with Spring Aspect-oriented Programming (AOP) complements Object-oriented Programming (OOP) by providing another way of thinking about program structure. The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect. Aspects enable the modularization of concerns (such as transaction management) that cut across multiple …

Spring – IoC

Introduction This Blog covers the Spring Framework implementation of the Inversion of Control (IoC) principle. From Spring official document, IoC is also known as dependency injection (DI). It is a process whereby objects define their dependencies (that is, the other objects they work with) only through constructor arguments, arguments to a factory method, or properties …

ISA and Pipelining

ISA Instruction set architecture A well-defined hardware/software interface The “contract” between software and hardware An ISA includes a specification of the set of opcodes (machine language), and the native commands implemented by a particular processor. Single-cycle and Pipelining 5 stages of pipelining

Latency and throughput

Latency (execution time): time to finish a fixed task Throughput (bandwidth): number of tasks per unit time Calculate speed up Average performance CPU Performance CPI: Cycles/instruction IPC = 1/CPI Used more frequently than CPI Favored because “bigger is better”, but harder to compute with What is the CPI? (1 cycle+2 cycles +3 cycles) / 3 …