Question
You're embedding a RocksDB-class LSM key-value engine inside a stateful service and must tune its memory budget. The box has 64GB RAM; the service process needs ~20GB, leaving ~40GB to split between the engine's block cache (serves reads), its write buffers/memtables (absorb writes before flush), and the OS page cache (serves the actual SST file reads). Workload: 200k ops/sec, 70% reads / 30% writes, value size ~2KB, working set ~15GB, p99 read latency target <5ms. Walk through how you'd partition that 40GB and which engine knobs you'd set, and what you'd measure to know you got it wrong.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.