Practice
Solution
Step 1: Identify write throughput and query pattern
The system requires high write throughput and efficient retrieval by user and timestamp, which suits wide-column stores that partition data by user ID.Step 2: Evaluate options against constraints
Relational DBs struggle with high write throughput and joins; document stores lack efficient range queries by timestamp; Redis lacks durability and is not ideal for large persistent datasets.Final Answer:
Option A -> Option AQuick Check:
Wide-column store partitions by user ID -> high write throughput and efficient user queries [check]
Solution
Step 1: Trace failure impact on write path
Without Kafka, writes accepted locally but not durably logged can be lost if the server crashes before Kafka recovers.Step 2: Eliminate other options
The system falls back to eventual consistency, causing stale reads temporarily is incorrect because fallback to eventual consistency is not automatic; The client's write blocks indefinitely until Kafka recovers, preventing data loss is wrong because writes may not block indefinitely; The system switches to causal consistency mode automatically to maintain availability is false as consistency mode does not switch automatically.Final Answer:
Option C -> Option CQuick Check:
Writes accepted locally but lost if server crashes before Kafka recovers [check]
Solution
Step 1: Understand HyperLogLog state loss impact
Losing the register state means the approximate count for that shard is lost; no exact user IDs are stored elsewhere.Step 2: Check consequences on cardinality
Without the register, the system cannot include that shard's data, causing undercounting, not overcounting or exact counts.Final Answer:
Option A -> Option AQuick Check:
Lost registers -> missing data -> undercounting unique users [check]
Solution
Step 1: Analyze read latency and schema flexibility needs
Social feeds require fast reads and flexible schema to handle diverse content types.Step 2: Compare database options
Relational DBs have join overhead; graph DBs excel at relationships but not high-volume feed reads; in-memory cache alone lacks persistence.Step 3: Justify wide-column NoSQL choice
Wide-column stores denormalize data for fast reads and support flexible schemas, fitting feed requirements.Final Answer:
Option B -> Option BQuick Check:
Wide-column NoSQL -> denormalized, low-latency reads [check]
Solution
Step 1: Identify bottleneck at scale
Edge routers handle packet forwarding at line rate; at 10x traffic, their CPU and forwarding ASICs are stressed first.Step 2: Evaluate other components
Route reflectors (A) scale better with hierarchical design; monitoring systems (C) can be scaled horizontally; client devices (D) are downstream and less critical for routing stability.Final Answer:
Option A -> Option AQuick Check:
Edge routers' CPU overload causes first failure at 10x traffic [check]
