Flashcard Deck · 20 cards · Public

System Design Essentials - Distributed Systems & Scalability Patterns

Master high-yield system design principles and distributed systems architecture for technical interviews. Covers CAP/PACELC theorems, caching strategies, database sharding, consistent hashing, and message queues.

Cards in this deck

(20 cards)

Preview terms and definitions before starting your study session.

#1
Term
CAP Theorem
Definition
States that a distributed system can guarantee at most two of three properties simultaneously during a network partition: Consistency (), Availability (), and Partition Tolerance (). Since network partitions () are inevitable in distributed systems, architects must trade off between (consistency over availability) and (availability over consistency).
#2
Term
PACELC Theorem
Definition
An extension of the CAP theorem. States that If there is a Partition (), trade off Availability () vs Consistency (); Else (), trade off Latency () vs Consistency ().
  • Example: DynamoDB defaults to (high availability and low latency), whereas traditional RDBMS prioritize .
#3
Term
Consistent Hashing
Definition
A distributed hashing technique where keys and nodes are mapped onto a logical 360-degree ring using a hash function. Minimizes key remapping when scaling nodes up or down to only keys on average, where is the number of keys and is the number of nodes.
#4
Term
Consistent Hashing - Virtual Nodes
Definition
To prevent uneven data distribution ('hotspots') and non-uniform node capacity in consistent hashing, each physical node is assigned multiple virtual nodes across the hash ring. This ensures a uniform hash distribution and better load balance.
#5
Term
Token Bucket Rate Limiting
Definition
An algorithm that allows traffic bursts up to a fixed bucket capacity . Tokens are added at a constant fill rate tokens/sec. A request consumes a token to pass; if no tokens remain, the request is dropped or delayed.
  • Pros: Handles bursts well.
  • Cons: Requires synchronization in distributed setups.
#6
Term
Leaky Bucket Rate Limiting
Definition
Requests enter a FIFO queue (the bucket) of capacity and are processed at a smooth, constant output rate . If the queue overflows, incoming requests are dropped.
  • Pros: Ensures stable, predictable output rate.
  • Cons: Bursts of traffic can cause requests to sit in the queue, increasing latency.
#7
Term
Cache-Aside (Lazy Loading)
Definition
The application directly interacts with both the cache and database. On read, the app checks the cache; on a cache miss, it reads from the DB, writes the result to the cache, and returns it.
  • Pros: Only requested data is cached; cache failures do not crash the app.
  • Cons: Cache miss penalty on initial read; risk of stale data.
#8
Term
Write-Through Caching
Definition
Data is written to the cache and the backing database synchronously in a single transaction before returning success to the caller.
  • Pros: High data consistency between cache and DB; zero cache misses on new reads.
  • Cons: Higher write latency since every write requires two network round trips.
Showing 8 of 20 cards in this deck.
Study All Now