System Design Concepts - 1

Here we will have a look into following important System Design Concepts.


Scaling


Consistent Hashing

Designing a Distributed Cache System:

What is Consistent Hashing ?
How Consistent Hashing Works ?


CAP (Consistency, Availability, Partition Tolerance) Theorem


Load Balancing


Ways of implementing Load Balancing
1. Smart Clients
2. Hardware Load Balancers
3. Software Load Balancers

Note:- For most systems, we should start with a software load balancer and move to smart clients or hardware load balancing as need arises.


Caching

1. Application Server Cache
2. Distributed Cache
3. Global Cache
4. Content Distribution Network (CDNs)


Cache Invalidation


Cache Eviction Policies

Following are some of the most common cache eviction policies:

  1. First In First Out (FIFO) : The cache evicts the first block accessed first.
  2. Last In First Out (LIFO) : The cache evicts the block accessed most recently first.
  3. Least Recently Used (LRU) : Discards the least recently used items first.
  4. Most Recently Used (MRU) : Discards, in contrast to LRU, the most recently used items first.
  5. Least Frequently Used (LFU) : Counts how often an item is needed, those that are used least often are discarded first.
  6. Random Replacement (RR) : Randomly selects a candidate item and discards it to make space when necessary.


Sharding or Data Partitioning


Partitioning Methods
1. Horizontal partitioning :
2. Vertical Partitioning :
3. Directory Based Partitioning :


Partitioning Criteria
1. Key or Hash-based partitioning :
2. List partitioning :
3. Round-robin partitioning :
4. Composite partitioning :


Common Problems of Sharding
1. Joins and Denormalization:
2. Referential integrity:
3. Rebalancing:


Indexes


Proxies




← Previous: Basics

Next: System Design Concepts - 2 →