Practice
Solution
Step 1: Identify failure isolation mechanism
Global circuit breakers (A) affect all services, causing blast radius expansion. Centralized load balancers (C) reroute but don't isolate resource exhaustion. Distributed cache (D) reduces load but doesn't isolate failures.Step 2: Understand bulkhead pattern role
Bulkheads partition resources (e.g., connection pools) per service, preventing one service's failure from impacting others.Final Answer:
Option A -> Option AQuick Check:
Bulkheads isolate failures by resource partitioning [check]
Solution
Step 1: Identify the decoupling requirement
Relational DB with row-level locking (Use a relational database with row-level locking to queue messages) cannot handle 1M writes/sec due to locking and durability overhead. Redis (Use Redis as an in-memory queue with TTL for message expiration) lacks durability guarantees and TTL causes message loss risk. Direct synchronous calls (Use direct synchronous HTTP calls from sender to all recipients) block sender and don't scale.Step 2: Evaluate Kafka's suitability
Kafka partitions by conversation ID ensure ordering and durability, enabling scalable fan-out with consumer groups.Final Answer:
Option A -> Option AQuick Check:
Kafka partitions -> durable, scalable decoupling [check]
Solution
Step 1: Identify Kafka's role in durability and ordering
Kafka provides a durable, append-only log with partition keys ensuring ordering per wallet or transaction, enabling atomicity and replayability.Step 2: Eliminate other options based on constraints
Relational DB synchronous commits (A) cause high latency and throughput bottlenecks; Redis (C) lacks durability guarantees; NoSQL eventual consistency (D) risks inconsistent ledger states.Final Answer:
Option C -> Option CQuick Check:
Kafka partitions with transaction keys -> durable, ordered event log [check]
Solution
Step 1: Analyze database scaling
Databases can be sharded and scaled horizontally; not usually the first bottleneck.Step 2: Analyze fan-out service scaling
Push-based fan-out causes write amplification proportional to follower count; at 10x scale, this bottleneck grows superlinearly and saturates first.Step 3: Analyze cache and web servers
Caches can be scaled with eviction and sharding; web servers scale with load balancers and stateless design.Final Answer:
Option A -> Option AQuick Check:
Fan-out write amplification causes first bottleneck at 10x scale [check]
Solution
Step 1: Analyze component scalability
Edge caches store counters in memory per user; memory is limited and grows with user count.Step 2: Compare bottlenecks
Logging (A) can be scaled with partitioning; Distributed Counter (C) sharding mitigates hot spots; API gateway (D) scales horizontally. Edge caches (B) hit memory limits first, causing eviction or failures.Final Answer:
Option D -> Option DQuick Check:
Edge caches fail first due to fixed local memory limits [check]
