Practice
Solution
Step 1: Identify the role of shards
Shards partition the index data and replicate it to provide fault tolerance and distribute write load.Step 2: Eliminate other components
Ingest nodes preprocess data but don't manage distribution; coordinating nodes route queries but don't store data; master nodes manage cluster metadata but don't handle data distribution.Final Answer:
Option B -> Option BQuick Check:
Shards partition and replicate data for fault tolerance [check]
Solution
Step 1: Analyze latency and availability needs
Low write latency globally requires writes to be accepted at multiple locations simultaneously.Step 2: Evaluate architectures
Active-Active with conflict resolution allows concurrent writes, reducing latency and improving availability despite complexity.Final Answer:
Option A -> Option AQuick Check:
Active-Active with conflict resolution -> low latency, high availability [check]
Solution
Step 1: Identify Expiration Worker's role
It removes expired snippets to free storage and prevent stale data serving.Step 2: Trace failure impact without Expiration Worker
Expired snippets accumulate indefinitely, increasing storage and possibly serving stale content.Final Answer:
Option A -> Option AQuick Check:
Without expiration cleanup, storage bloat and stale data occur [check]
Solution
Step 1: Role of message queue in gRPC server
The queue buffers messages for slow or disconnected clients, enabling retries and flow control.Step 2: Effect of removing the queue
Without the queue, messages sent to slow/disconnected clients are dropped immediately, causing message loss without retries.Final Answer:
Option C -> Option CQuick Check:
No queue -> message loss on slow/disconnected clients [check]
Solution
Step 1: Analyze scaling bottlenecks
Expiration Worker scans all snippets to delete expired ones; at 10x scale, scan latency grows linearly.Step 2: Compare other components
Relational DB (A) is not primary storage; key-value stores (C) shard well; Kafka (D) scales with partitioning but expiration scanning is a linear bottleneck.Final Answer:
Option C -> Option CQuick Check:
Expiration scanning is linear and slows down first at scale [check]
