Database / RocksDB Basics Interview Questions
Describe the Read Path in RocksDB?
- A Get call for a key first checks the active MemTable, since that holds the most recent writes
- If not found there, it checks any immutable MemTables still waiting to be flushed
- It then checks SSTables starting at Level 0, using each file's Bloom filter to quickly skip files that definitely don't contain the key
- For files the Bloom filter can't rule out, the index block locates the right data block, and a binary search finds the exact entry
- This continues down through successive levels until the key is found, or every relevant level has been checked and the key is reported as not found
This layered search, from freshest to oldest data, is exactly why a single Get can, in the worst case, touch several different structures before returning an answer.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
