- Key Benefit: Adding or removing a server node requires remapping only keys on average (where is the number of keys and is the number of servers).
- Virtual Nodes: Uses multiple virtual positions per physical server to ensure uniform data distribution and prevent hotspots.
System Design - Distributed Systems, Load Balancing & High Availability
Cards in this deck
(20 cards)Preview terms and definitions before starting your study session.
- Round Robin: Distributes requests sequentially across servers.
- Weighted Round Robin: Routes traffic based on assigned server capacity/weight.
- Least Connections: Directs traffic to the server with the fewest active connections (ideal for long sessions).
- IP Hash: Maps client IP to a server using a hash function, ensuring session persistence (sticky sessions).
- Layer 4 (Transport Layer): Routes traffic based on IP address and TCP/UDP ports without inspecting packet payloads. Highly efficient and fast (e.g., HAProxy in TCP mode).
- Layer 7 (Application Layer): Routes traffic based on application data such as HTTP headers, cookies, or URL paths. Enables smart routing, SSL termination, and content-based caching (e.g., NGINX, AWS ALB).
- Primary-Replica (Master-Slave): Writes go to the primary node and are replicated to read-only replicas. Solves read scalability but write capacity remains limited to the primary.
- Multi-Primary (Master-Master): Multiple nodes accept write operations. Improves write availability, but requires complex conflict resolution algorithms (e.g., Vector Clocks, Last-Write-Wins).
- Pros: Handles massive write/read throughput beyond a single server's limits.
- Cons: High complexity; makes cross-shard joins, distributed transactions, and dynamic re-sharding difficult.
2. If Cache Hit: Returns data directly.
3. If Cache Miss: Reads data from the database, writes it to the cache, and returns it to the client.
- Pros: Cache only contains requested data; handles cache node failures gracefully.
- Cons: Cache miss penalty on initial read; potential data staleness if DB writes bypass the cache.
- Write-Through: Data is written simultaneously to both the cache and the underlying database. Guarantees consistency and durability, but increases write latency.
- Write-Back (Write-Behind): Data is written immediately to the cache, and asynchronously flushed to the database at defined intervals.
- Pros: Extremely low write latency and high throughput.
- Cons: Risk of data loss if the cache node crashes before flushing to storage.
- Pull CDN: Cache servers fetch content from the origin server on-demand when a user requests it for the first time. Low setup effort; efficient for high-traffic sites.
- Push CDN: Origin server actively uploads new or updated content directly to CDN edge nodes before requests arrive. Ideal for static, infrequently changing assets or critical system updates.
Related Flashcard Sets
Explore similar study materials created by the community
TypeScript - Advanced Type Systems, Generics & Design Patterns
Master advanced TypeScript features like generics, conditional types, and mapped types to build robust, scalable applications. This deck covers essential utility types, type narrowing techniques, discriminated unions, and the nuances between interfaces and type aliases, empowering you to write highly maintainable and type-safe code.
Harvard ECON1011 - Intermediate Microeconomics: Game Theory & Market Structures
Master key concepts in intermediate microeconomics with this comprehensive flashcard deck. Dive deep into game theory, market structures, strategic pricing, and general equilibrium models, perfect for Harvard ECON1011 students and anyone aiming to ace microeconomics.
MIT 18.03 - Differential Equations: Ordinary Differential Equations, Laplace & Fourier
Master MIT 18.03 Differential Equations with high-yield flashcards covering first and second-order ODEs, Laplace transforms, Fourier series, and matrix exponential state-space systems.
CPA Exam FAR - Financial Accounting & Reporting: US GAAP & Revenue Recognition
Master high-yield CPA FAR concepts covering ASC 606 revenue recognition, ASC 842 lease accounting, inventory valuation methods, and consolidated financial statements.