Limited Time Offer:Up to 20% off Hello Interview Premium
Up to 20% off Hello Interview Premium 🎉
Hello Interview
Learn System Design
Introduction
How to Prepare
Delivery Framework
Core Concepts
Key Technologies
Common Patterns
Question Breakdowns
Networking Essentials
API Design
Data Modeling
Caching
Sharding
Consistent Hashing
CAP Theorem
Quick Reference
Database Indexing
Numbers to Know
Bitly
Dropbox
Local Delivery Service
Ticketmaster
FB News Feed
Tinder
LeetCode
WhatsApp
Rate Limiter
FB Live Comments
FB Post Search
YouTube Top K
Uber
YouTube
Web Crawler
Ad Click Aggregator
News Aggregator
Yelp
Strava
Online Auction
Price Tracking Service
Instagram
Robinhood
Google Docs
Distributed Cache
Job Scheduler
Payment System
Metrics Monitoring
ChatGPT
Real-time Updates
Dealing with Contention
Multi-step Processes
Scaling Reads
Scaling Writes
Handling Large Blobs
Managing Long Running Tasks
Redis
Elasticsearch
Kafka
API Gateway
Cassandra
DynamoDB
PostgreSQL
Flink
ZooKeeper
Time Series Databases
Data Structures for Big Data
Vector Databases
Vote For New Content
Pricing
Sign in / Sign up
Search
⌘K
Pricing

Tutor

Hello InterviewQuick Reference
Full Article
Quick Reference

CAP Theorem

CAP Basics

CAP Properties

Consistency means all nodes see the same data at the same time and differs from ACID consistency; Availability means every request to a non-failing node gets a possibly stale response; Partition Tolerance means the system continues despite message loss or network partitions.
  • Consistency: All nodes see the same data at the same time; not the same as ACID consistency.
  • Availability: Every request to a non-failing node receives a response, possibly stale.
  • Partition Tolerance: System continues despite message loss or network partitions between nodes.

Interview Decision

Prefer availability by default

Default for most designs; stale data is acceptable when inconsistency is not catastrophic.

Ask latest-read question

Ask: "Does every read need to read the most recent write?".

Treat partitions as mandatory

Network failures will happen; choose consistency or availability during a partition.

Choose Consistency

Ticket Booking Systems need consistency to prevent two users booking the same seat; E-commerce Inventory needs consistency to avoid showing one remaining item to multiple users; Financial Systems need accurate order books because stale data can cause incorrect-price trades.
  • Ticket Booking Systems: Prevent two users from booking the same seat during a partition.
  • E-commerce Inventory: Avoid showing one remaining item as available to multiple users.
  • Financial Systems: Stock trading platforms need accurate order books; stale data can cause wrong-price trades.

Choose Availability

Social Media can show an old profile picture for a few minutes; Content Platforms can show old movie descriptions temporarily; Review Sites prefer slightly outdated restaurant hours over no information.
  • Social Media: Old profile pictures for a few minutes are acceptable.
  • Content Platforms: Old movie descriptions are acceptable temporarily.
  • Review Sites: Slightly outdated restaurant hours briefly are better than no information.

Design Impact

Consistency Patterns

Distributed Transactions use two-phase commit to keep stores in sync but add complexity and latency; Single-Node Solutions avoid propagation issues with one database instance but limit scalability.
  • Distributed Transactions: Use two-phase commit to keep cache and database in sync; adds complexity and latency.
  • Single-Node Solutions: One database instance avoids propagation issues but limits scalability.

Availability Patterns

Multiple Replicas serve reads from replicas with asynchronous replication for better availability and possible staleness; Change Data Capture propagates primary database changes asynchronously to replicas, caches, and other systems.
  • Multiple Replicas: Serve reads from replicas; asynchronous replication improves availability with possible staleness.
  • Change Data Capture (CDC): Propagate primary database changes asynchronously to replicas, caches, and other systems.

Technology Choices

Traditional RDBMSs such as PostgreSQL and MySQL fit consistency-prioritized designs; Google Spanner is a consistency-prioritized choice; DynamoDB can be configured for either priority; Cassandra is an availability-prioritized choice; Redis Clusters are an availability-prioritized choice.
  • Traditional RDBMSs: PostgreSQL and MySQL fit consistency-prioritized designs.
  • Google Spanner: Technology choice when prioritizing consistency.
  • DynamoDB: Configurable for either priority based on chosen mode.
  • Cassandra: Technology choice when prioritizing availability.
  • Redis Clusters: Technology choice when prioritizing availability.

Advanced Choices

Feature Choices

Ticketmaster uses consistency for booking seats and availability for viewing event details; Tinder uses consistency for matching and availability for viewing profiles.
  • Ticketmaster: Consistency for booking seats; availability for viewing event details.
  • Tinder: Consistency for matching; availability for viewing profiles.

Consistency Models

Eventual Consistency is the default behavior of most distributed databases and converges over time; Strong Consistency makes all reads reflect the most recent write and is the most expensive model; Causal Consistency makes related events appear in the same order to all users; Read-your-own-writes Consistency lets users see their own updates immediately while others may see older versions.
  • Eventual Consistency: Default behavior of most distributed databases; consistency returns over time.
  • Strong Consistency: All reads reflect the most recent write; most expensive but needed for absolute accuracy.
  • Causal Consistency: Related events appear in the same order to all users.
  • Read-your-own-writes Consistency: Users see their own updates immediately; others may see older versions.

Your account is free and you can post anonymously if you choose.

Reading Progress

On This Page

CAP Basics

CAP Properties

Interview Decision

Choose Consistency

Choose Availability

Design Impact

Consistency Patterns

Availability Patterns

Technology Choices

Advanced Choices

Feature Choices

Consistency Models

Questions
Meta SWE Interview QuestionsAmazon SWE Interview QuestionsGoogle SWE Interview QuestionsOpenAI SWE Interview QuestionsEngineering Manager (EM) Interview Questions
Learn
Learn System DesignLearn DSALearn BehavioralLearn ML System DesignLearn Low Level DesignGuided Practice
Links
FAQPricingGift PremiumHello Interview Premium
Legal
Terms and ConditionsPrivacy PolicySecurity
Contact
About UsProduct Support

7511 Greenwood Ave North Unit #4238 Seattle WA 98103


© 2026 Optick Labs Inc. All rights reserved.