Practice
Solution
Step 1: Identify the bottleneck as CPU and memory on a single DB server
Vertical scaling adds resources to the existing server to handle more load without architectural changes.Step 2: Evaluate horizontal scaling and other options
Horizontal scaling requires application changes for sharding; caching reduces reads but not CPU-bound writes; switching DB types is a different trade-off.Final Answer:
Option B -> Option BQuick Check:
Vertical scaling adds resources to one server without code changes [check]
Solution
Step 1: Analyze replication under network partitions
Synchronous replication blocks writes on slow or unreachable replicas, hurting availability.Step 2: Asynchronous replication tolerates partitions
Allows writes to proceed locally and replicates changes later, favoring availability over immediate consistency.Final Answer:
Option A -> Option AQuick Check:
Async replication favors availability during partitions [check]
Solution
Step 1: Identify multi-region write and availability requirements
Multi-region writes require conflict resolution and high availability without synchronous blocking.Step 2: Compare Redis and DynamoDB capabilities
DynamoDB Global Tables support multi-region writes with built-in conflict resolution and eventual consistency; Redis lacks native multi-region write support.Final Answer:
Option A -> Option AQuick Check:
DynamoDB Global Tables -> multi-region writes with conflict resolution [check]
Solution
Step 1: Identify scaling bottlenecks
Central metadata service (The central shard metadata service, due to increased coordination overhead) may be distributed or avoided; shards (The individual database shards, because storage capacity limits are reached first) scale horizontally; client caches (The client-side routing cache, as it cannot handle the increased number of shards efficiently) can be sharded or refreshed incrementally.Step 2: Analyze hash ring management at scale
Hash ring management (The hash ring management service, because updating and propagating ring changes becomes a bottleneck) requires updating and propagating ring changes to all nodes; at 10x scale, this coordination overhead and update frequency cause it to become the first bottleneck.Final Answer:
Option C -> Option CQuick Check:
Hash ring updates bottleneck first at large scale [check]
Solution
Step 1: Identify stateful components in location tracking
WebSocket servers hold persistent connections per driver and rider, consuming memory and CPU.Step 2: Analyze scaling challenges
At 10x scale, WebSocket servers hit connection limits and memory pressure first; databases can shard and cache; surge pricing is stateless and scalable; mobile clients scale independently.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket servers bottleneck first due to connection limits [check]
