Practice
Solution
Step 1: Identify the need for decoupling writes from fan-out
Handling 1 million writes per second with synchronous fan-out is not feasible on a single machine or direct calls.Step 2: Evaluate components for asynchronous buffering
Kafka provides durable, partitioned logs that buffer writes and allow scalable asynchronous delivery. Relational DBs can't handle this write load synchronously. Redis lacks durability guarantees for this scale. Direct HTTP calls block and don't scale.Final Answer:
Option D -> Option DQuick Check:
Kafka buffers writes asynchronously, enabling high write throughput [check]
Solution
Step 1: Trace failure impact of update stream loss
The update stream failure stops feature updates but does not block reads or cause permanent data loss.Step 2: Identify component relying on update stream
A/B testing routing depends on fresh feature updates to decide traffic splits; without updates, routing falls back to control model only.Final Answer:
Option C -> Option CQuick Check:
Update stream failure -> A/B routing fallback to control model [check]
Solution
Step 1: Analyze latency and consistency needs
Real-time games require fast access to player state with strong consistency.Step 2: Evaluate architecture trade-offs
Stateful servers with in-memory state reduce latency and allow immediate state updates; periodic persistence balances durability.Final Answer:
Option D -> Option DQuick Check:
Stateful in-memory state + persistence -> low latency, consistent [check]
Solution
Step 1: Understand Ticket Server crash impact
If the server crashes post-allocation but pre-acknowledgment, it cannot confirm the block was assigned.Step 2: Trace ID block state
The allocated block is effectively lost, causing gaps in the global ID sequence, but clients do not reuse lost blocks, preventing duplicates.Final Answer:
Option B -> Option BQuick Check:
Crash after allocation -> lost ID blocks, no duplicates [check]
Solution
Step 1: Identify stateful components at risk
Stateful microservices holding WebSocket connections cannot easily shard or move connections, limiting horizontal scaling.Step 2: Compare other components' scaling characteristics
Shared DB and service discovery can be sharded or cached; API Gateway can be scaled horizontally with load balancers.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket connections limit microservices horizontal scaling [check]
