Practice
Solution
Step 1: Identify the need to limit response size
Fetching large lists risks high memory usage and slow responses; pagination limits data per request.Step 2: Recognize pagination as the standard REST approach
Using query parameters likepageandlimitallows clients to request manageable chunks.Final Answer:
Option A -> Option AQuick Check:
Pagination with query params controls response size [check]
Solution
Step 1: Role of consistent hashing ring metadata
The ring metadata maps keys to nodes; without it, nodes cannot route requests correctly, leading to inconsistent data placement.Step 2: Consequence of missing ring metadata
Without this metadata, nodes lose synchronization on key ownership, causing data corruption as writes go to wrong nodes; request failure (The cache node receiving the request cannot determine the correct node, causing request failure or indefinite retry) is secondary, and fallback (The system falls back to a centralized database for all requests, increasing latency) is not automatic.Final Answer:
Option A -> Option AQuick Check:
Missing ring metadata causes data corruption due to lost key-node mapping [check]
Solution
Step 1: Understand asynchronous trace context propagation
Embedding trace context in message metadata headers leverages messaging system features to propagate context without modifying payload or tight coupling.Step 2: Evaluate other options
HTTP headers don't exist in messaging protocols. Centralized DB lookup adds latency and coupling. Generating new trace IDs breaks trace continuity and requires complex offline correlation.Final Answer:
Option A -> Option AQuick Check:
Message metadata headers preserve trace context asynchronously [check]
Solution
Step 1: Understand lock release in Redlock
Locks are released by explicit DEL commands; network partition can prevent this.Step 2: Trace failure impact
If lock not released, it remains held until TTL expires, potentially blocking other clients.Final Answer:
Option A -> Option AQuick Check:
Unreleased lock -> held until TTL expires, causing potential deadlock [check]
Solution
Step 1: Identify load distribution in range sharding
Range sharding partitions data by key ranges, causing uneven load if some ranges are hotter.Step 2: Analyze scaling impact
At 10x scale, shards with hot ranges become overloaded first, causing failures before other components.Final Answer:
Option B -> Option BQuick Check:
Range shard hotspots cause uneven load and early failures [check]
