Practice
Solution
Step 1: Trace replica behavior at step 4
Replica applies WAL entries to its local store to catch up with primary.Step 2: Understand acknowledgment timing
Replica acknowledges primary only after applying entries to ensure durability and consistency.Final Answer:
Option B -> Option BQuick Check:
Replica applies then acknowledges -> ensures data durability [check]
Solution
Step 1: Identify storage needs for low-latency random access and strong consistency
Databases require fast block-level access with strong consistency for transactional integrity.Step 2: Evaluate storage types
Block storage offers raw device access with low latency and strong consistency; object storage is optimized for throughput and eventual consistency; file storage adds overhead and less suited for random writes; tape is offline archival.Final Answer:
Option A -> Option AQuick Check:
Block storage = low latency + strong consistency [check]
Solution
Step 1: Analyze freshness and latency requirements
Trending photos must be updated with low latency and high freshness, ruling out long batch intervals.Step 2: Evaluate architectures
Batch jobs every 6 hours (A) are too stale. Client polling (C) adds load and latency. CDN cache invalidation (D) is coarse-grained and slow. Streaming pipeline (B) updates trending scores in real-time and stores in fast KV store, meeting freshness and latency.Final Answer:
Option D -> Option DQuick Check:
Streaming pipeline enables real-time trending updates [check]
Solution
Step 1: Analyze requirement
Fast traversal with frequent updates demands low-latency graph traversals and quick writes.Step 2: Evaluate architectures
Relational DBs have high JOIN cost; batch pipelines add latency; key-value stores lack flexible traversal.Step 3: Choose architecture
In-memory graph DBs with eventual consistency balance fast traversals and update throughput.Final Answer:
Option D -> Option DQuick Check:
In-memory graph DBs optimize traversal speed and handle frequent updates well [check]
Solution
Step 1: Understand role of random payload in KSUID
The random payload ensures uniqueness among IDs generated at the same timestamp across nodes.Step 2: Analyze consequences of removing random payload
Without random payload, IDs generated at the same timestamp collide, causing duplicates and predictability; timestamp remains, so sortability is intact (A false); length and encoding unchanged (C and D false).Final Answer:
Option B -> Option BQuick Check:
Random payload prevents collisions at identical timestamps [check]
