ByteByteGo · System Design Fundamentals

8 Concepts You Must Know

Visual reference for distributed systems design interviews & production architecture

01 / 08
Use Caching for Faster Reads
Client Cache ① HIT ② MISS Database populate
  • Check cache first; fall back to DB on miss
  • Strategies: read-through, write-through, write-back
  • Tools: Redis, Memcached, CDN edge cache
02 / 08
Use Async Writes (Message Queues)
Client Queue Requests Worker Worker DB
  • Decouple producers from consumers
  • Prevents overload; retries on failure
  • Tools: Kafka, RabbitMQ, SQS, Bull
03 / 08
Use LSM-Tree Database
Write Memtable in-memory flush SSTable (L0 → L1 → LN) compact Read
  • Writes go to in-memory Memtable first
  • Flushed to disk as immutable SSTables
  • Used by: Cassandra, RocksDB, LevelDB
04 / 08
Implement Redundancy & Failover
Primary replicate Standby Failover Decision Server Server
  • Active/passive or active/active setups
  • Health checks trigger automatic promotion
  • Eliminates single points of failure (SPOF)
05 / 08
Use Load Balancing
Cli ent LB router Server 1 Server 2 Server 3 Round Robin / Least Conn
  • Distributes traffic across server pool
  • Algorithms: round-robin, least connections, IP hash
  • Tools: Nginx, HAProxy, AWS ALB
06 / 08
Use Replication
Primary Writes sync Replica 1 Replica 2 Replica 3 Read Read Read
  • Primary handles writes; replicas serve reads
  • Sync vs async replication trade-offs
  • Boosts read throughput & provides redundancy
07 / 08
Use Proper Indexes
B-Tree Index 10 20 30 40 Record A Record B Record C Record D O(log n) w/ index O(n) full scan
  • B-Tree for range queries; Hash for equality
  • Speeds reads, slows writes — choose wisely
  • Composite indexes: order of columns matters
08 / 08
Use Sharding to Horizontally Scale
Unsharded DB partition key Shard 1 user 0-33% Shard 2 user 34-66% Shard 3 user 67-100% Each shard = independent DB node
  • Split data across nodes by partition key
  • Consistent hashing minimizes resharding
  • Watch out for cross-shard joins & hot spots
BONUS A
Use Centralized Logging
Svc A Svc B Svc C Log stash Elastic search Kibana ELK Stack
  • Aggregate logs from all services centrally
  • ELK stack: Logstash → Elasticsearch → Kibana
  • Enables search, alerting, dashboards
BONUS B
Use Block & Object Storage
Object Storage Obj Obj Obj Obj Obj Obj Payload Id Object Object Id Payload
  • Block: low-latency, attached volumes (EBS)
  • Object: flat namespace, infinite scale (S3)
  • Use S3 for blobs; block storage for DBs
BONUS C
Use CDN to Reduce Latency
User User DNS CDN Edge Node CDN Edge Node Origin Server
  • Serves static assets from edge nodes near users
  • DNS routes to nearest point of presence (PoP)
  • Tools: Cloudflare, CloudFront, Fastly
REF
Quick Reference Cheatsheet
Cache → Redis, Memcached
Queue → Kafka, RabbitMQ
LSM-DB → Cassandra, RocksDB
Failover→ active-passive / active-active
LB → Nginx, HAProxy, ALB
Replica → primary + N read replicas
Index → B-Tree, Hash, Composite
Shard → consistent hashing
Logging → ELK Stack
Storage → S3 blobs / EBS block
CDN → Cloudflare, CloudFront