System design comparisons
Interviewers ask you to defend your choices. Each page compares two options side by side. It tells you the real differences, when each option is better and how to explain your choice.
- Active-active vs Active-passiveActive-active serves production traffic from multiple instances or regions at once.
- API gateway vs Load balancerAn API gateway applies API-level policies.
- At-least-once vs Exactly-onceAt-least-once permits duplicate deliveries.
- Avro vs ProtobufChoose Avro when your event pipeline depends on writer-schema resolution, generic data processes, and replay across schema versions.
- B-tree vs LSM treeChoose a B-tree when point reads, ordered scans, and predictable read latency are central.
- Batch processing vs Stream processingBatch processing computes results for a bounded dataset.
- Blue-green vs Canary deploymentBlue-green switches production traffic between two environments.
- Cache-aside vs Read-throughWith cache-aside, application code checks the cache, queries the database on a miss, and fills the cache.
- Cassandra vs DynamoDBChoose Cassandra when deployment flexibility and control over replication, storage, and cluster operations justify the work to operate a distributed database.
- Cassandra vs MongoDBChoose Cassandra for heavy write loads, known partition-based queries, and writes in multiple regions.
- CDN vs CacheA CDN is a delivery network across geographic locations that often caches HTTP content near users.
- Choreography vs OrchestrationChoreography lets services react to events and decide their next steps.
- Clustered vs Non-clustered indexA clustered index stores table rows at the leaves of the index tree.
- Consistent hashing vs Rendezvous hashingChoose ring-based consistent hashing when many nodes make placement cost per request important.
- Data warehouse vs Data lakeA data warehouse favors curated data and predictable analytical queries.
- DynamoDB vs MongoDBChoose DynamoDB when you know your access patterns, use keys, and want an AWS-managed service that automatically manages partitions.
- Elasticsearch vs PostgreSQL full-text searchChoose PostgreSQL full-text search when keywords must work with relational filters, permissions, and transactional updates without another datastore.
- Elasticsearch vs SolrElasticsearch and Solr both use Apache Lucene for distributed search.
- Encryption vs HashingEncryption keeps data private and lets authorized users recover the original data.
- ETL vs ELTETL transforms data before it loads the data into the analytical destination.
- Event sourcing vs CQRSEvent sourcing stores authoritative state as a sequence of events.
- Fan-out on write vs Fan-out on readFan-out on write prepares recipients' feeds when an author publishes a post.
- Flink vs Spark StreamingChoose Flink when continuous, low-latency execution and complex keyed state or event-time logic determine the design.
- Geohash vs H3Geohash encodes space as rectangles with exact prefix-based subdivision.
- GraphQL vs gRPCChoose GraphQL when clients need flexible views that combine data across services.
- gRPC vs RESTChoose gRPC for controlled service-to-service APIs that need generated clients, typed contracts, or bidirectional streams.
- HLS vs DASHChoose HLS when Apple devices must play video natively.
- Horizontal scaling vs Vertical scalingHorizontal scaling adds instances to share work.
- HTTP/1.1 vs HTTP/2HTTP/2 multiplexes concurrent requests over one TCP connection.
- HTTP/2 vs HTTP/3HTTP/2 multiplexes requests over TCP.
- JSON vs ProtobufChoose JSON when easy integration, readable payloads, and broad client support matter most.
- JWT vs SessionsChoose JWT access tokens when services must verify identity locally and can accept a limited revocation delay.
- Kafka vs KinesisChoose Kafka for deployment flexibility, a broad stream ecosystem, and control over log configuration.
- Kafka vs PulsarChoose Kafka when a partitioned event log and its stream-processing ecosystem meet your needs, especially if your team already operates Kafka.
- Kafka vs SQSChoose Kafka for a retained event stream that independent consumers can read and replay.
- Lambda architecture vs Kappa architectureLambda architecture uses separate batch and stream paths.
- Latency vs ThroughputLatency measures the time for one operation.
- Layer 4 vs Layer 7 load balancingLayer 4 load balancing routes transport flows with connection metadata.
- Leader-follower vs Multi-leader replicationLeader-follower replication, also called master-slave, accepts writes through one leader per replication group.
- Long polling vs WebSocketsLong polling uses repeated HTTP requests that wait for data.
- LRU vs LFULRU removes the entry with the oldest last access.
- MongoDB vs PostgreSQLChoose PostgreSQL when relationships, database constraints, and transactions across related records guide the design.
- Monolith vs MicroservicesA monolith deploys application modules together.
- MySQL vs MongoDBChoose MySQL when relationships, database-enforced constraints, and transactions across related records determine the design.
- Nginx vs HAProxyChoose Nginx when one component must serve static files, cache HTTP responses, and act as a reverse proxy for application traffic.
- Normalization vs DenormalizationNormalization uses data dependencies to reduce duplicate data and update errors.
- OAuth vs SAMLOAuth 2.0 delegates API access.
- OLTP vs OLAPOLTP (online transaction processing) handles small, concurrent operations on current application state.
- Optimistic locking vs Pessimistic lockingOptimistic locking detects conflicting changes before it accepts a write.
- Polling vs WebhooksWith polling, the consumer checks for changes on its own schedule.
- PostgreSQL vs MySQLChoose PostgreSQL when richer constraints, specialized indexes, or extensions simplify your data model and queries.
- Pub/sub vs Message queueUse pub/sub when each independent consumer needs an event.
- Push vs PullWith push, a sender delivers updates when they are available.
- RabbitMQ vs SQSChoose RabbitMQ when the design needs broker-side routing, delivery control, or deployment outside AWS.
- Raft vs PaxosRaft defines a leader-based replicated log.
- Rate limiting vs ThrottlingRate limiting defines how much traffic a system allows.
- Redis vs DynamoDBChoose Redis for a cache in memory, counters, and operations on structures such as sorted sets.
- Redis vs KafkaChoose Redis for fast shared state, a cache, or simple message delivery.
- Redis vs MemcachedChoose Redis for server-side data structures, atomic multi-step operations, or built-in replication and persistence options.
- Replication vs ShardingReplication keeps copies of the same data.
- REST vs GraphQLChoose REST for resource-oriented APIs when predictable operations and simple HTTP caches matter most.
- Reverse proxy vs Forward proxyA reverse proxy represents servers to clients.
- Row-oriented vs Columnar storageRow-oriented storage keeps a record's fields together.
- RPC vs RESTRPC models an API as callable operations.
- S3 vs EBSUse S3 for objects such as photos, videos, backups, and analytical datasets that you access through an API.
- Saga vs Two-phase commitA saga commits local transactions in sequence.
- Serverless vs ContainersChoose serverless functions for short, event-driven work with variable demand.
- Sharding vs PartitioningSharding is a form of partitioning that divides data across database nodes.
- Snowflake IDs vs UUIDsChoose Snowflake-style IDs when compact, roughly time-ordered 64-bit keys justify control of worker identities and clock behavior.
- SOAP vs RESTSOAP is a protocol for XML messages.
- Spark vs Hadoop MapReduceSpark supports batch jobs with multiple stages, SQL, iterative computation, and streaming.
- SQS vs SNSUse SQS to hold work for consumers that pull and process messages at their own rate.
- Strong consistency vs Eventual consistencyHere, strong consistency means linearizability.
- Symmetric vs Asymmetric encryptionUse symmetric encryption to protect application data efficiently.
- Synchronous vs Asynchronous replicationSynchronous replication waits for the required replica acknowledgments before it reports write success.
- TCP vs UDPTCP provides a reliable byte stream in order.
- UUID vs Auto-increment IDsChoose UUIDs when independent services, regions, or offline clients must create IDs without a shared allocator.
- Vertical vs Horizontal partitioningVertical partitioning splits a table by columns.
- WebSockets vs Server-Sent EventsChoose WebSockets for frequent communication in both directions over one connection, such as chat or shared document edits.
- WebSockets vs WebRTCUse WebSockets for client-server messages, such as chat, notifications, and live application updates.
- Write-through vs Write-back cacheWrite-through waits for the backing store before it confirms a write.
- ZooKeeper vs etcdZooKeeper focuses on hierarchical coordination primitives.