This is basically a 'design DynamoDB but explain every decision' question and I was not ready for the full scope of it.
Start by clarifying requirements and scale, then present a high-level architecture using consistent hashing for sharding and quorum-based replication across zones. Walk through the read/write paths, storage engine (LSM-tree), and failure handling, emphasizing trade-offs and how each feature (TTL, conditional updates, range scans) is implemented. Conclude with observability and monitoring strategies.
Pro tip: Relate the design to LinkedIn's data infrastructure (e.g., Espresso, Venice) and highlight how ML feature stores could leverage this KV store for low-latency feature retrieval, showing domain awareness.
Ask about expected throughput, latency SLOs, data size, and consistency needs. Confirm the need for multi-zone availability and the specific semantics of per-key read-after-write consistency.
Propose a sharded, replicated system using consistent hashing for partitioning and a quorum-based replication protocol (e.g., Paxos/Raft) across zones. Mention a coordinator service for routing and metadata management.
Define a simple key-value API with operations: Get, Put, Delete, ConditionalPut (CAS), and Scan (range). Include TTL as a parameter on writes. Discuss how to support range scans via ordered sharding (e.g., range-based partitioning).
Detail the write path: client -> coordinator -> shard leader -> replication to followers -> ack. Use LSM-tree (e.g., RocksDB) for storage with WAL for durability. For reads, route to leader for read-after-write consistency or to followers with version checks. Explain TTL via expiration timestamps and conditional updates via versioning.
Describe failure detection (heartbeats), leader election, and data repair (anti-entropy). For observability, cover metrics (latency, throughput, error rates), tracing, and logging, with alerts on SLO violations.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.