Prev Next

Database / ScyllaDB Interview questions

Explain the internal working of ScyllaDB's read path?

A read has to reconstruct the current value of a row from potentially several places at once, since data for one partition can be spread across the memtable and multiple SSTables.

flowchart TD A[Coordinator receives read] --> B[Identify replicas for the token] B --> C[Send read request to required replicas per consistency level] C --> D[Each replica checks memtable] D --> E[Each replica checks row cache] E --> F[Bloom filters rule out irrelevant SSTables] F --> G[Remaining SSTables' indexes locate the row] G --> H[Merge fragments from memtable + SSTables] H --> I[Apply tombstones, keep latest values] I --> J[Return merged result to coordinator] J --> K[Coordinator reconciles replies, may trigger read repair] K --> L[Result returned to client]

Each replica first checks its memtable (freshest data) and row cache (hot data already assembled), then uses per-SSTable bloom filters to cheaply skip SSTables that provably don't contain the requested key, and consults the index of the remaining candidates to locate the row's position on disk. All the fragments found are merged, respecting write timestamps and tombstones, into a single up-to-date view of the row. If the read's consistency level requires multiple replicas to respond, the coordinator compares their answers and, if they disagree, can trigger a foreground read repair to reconcile the difference before returning the final result to the client - which is one way ScyllaDB heals minor replica drift opportunistically, on top of scheduled anti-entropy repair.

What lets a replica cheaply skip SSTables that don't contain a key?
What can the coordinator trigger if replicas disagree on a read's result?

Invest now in Acorns!!! 🚀 Join Acorns and get your $5 bonus!
Acorns Logo

Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!

Earn passively and while sleeping

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.

Robinhood Logo

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 Logo

Webull! Receive free stock by signing up using the link: Webull signup.

More Related questions...

What is ScyllaDB? What are the key features of ScyllaDB? What is the shard-per-core architecture in ScyllaDB? Define a partition key in ScyllaDB? What is a clustering key in ScyllaDB? What are the data types supported by ScyllaDB? Describe the Seastar framework used by ScyllaDB? What are the types of consistency levels in ScyllaDB? List the compaction strategies available in ScyllaDB? How do you create a table in ScyllaDB? What is a materialized view in ScyllaDB? Explain the purpose of the commit log in ScyllaDB? What is ScyllaDB Alternator? How do you apply TTL to data in ScyllaDB? What is ScyllaDB Manager? Why doesn't ScyllaDB rely on a JVM? How does ScyllaDB achieve linear scalability per node? What is the difference between ScyllaDB and Apache Cassandra? When should you use a local secondary index versus a global one? What happens when a wide partition forms in ScyllaDB? How is data replicated across nodes in ScyllaDB? Why should you avoid large batch statements in ScyllaDB? What is the difference between ScyllaDB and DynamoDB? How does ScyllaDB handle node failure with hinted handoff? When would you choose LOCAL_QUORUM over QUORUM? How can you optimize write performance in ScyllaDB? What is the difference between memtables and SSTables? Why do we use tombstones in ScyllaDB? How does ScyllaDB's shard-aware driver route requests? What is the difference between STCS and LCS compaction? When should you use lightweight transactions in ScyllaDB? How is repair implemented in ScyllaDB? Why doesn't ScyllaDB support arbitrary ad-hoc joins? What is the difference between ScyllaDB tablets and vnodes? How do you troubleshoot high read latency in ScyllaDB? Explain the internal working of the Seastar future-promise model? Explain the execution flow of a write request in ScyllaDB? Explain the lifecycle of an SSTable in ScyllaDB? How does ScyllaDB guarantee strongly consistent schema changes using Raft? What happens internally when ScyllaDB performs compaction? How can you optimize a multi-datacenter ScyllaDB deployment for latency? Which is better and why: LOCAL_QUORUM or ONE for a globally distributed app? How does token-aware routing improve latency in ScyllaDB? Why is the gossip protocol critical to ScyllaDB's cluster membership? How do you troubleshoot compaction backlog in ScyllaDB? Explain the internal working of ScyllaDB's read path? What happens when a node becomes unavailable in a ScyllaDB cluster? How does ScyllaDB implement Change Data Capture internally? Explain the execution flow of a lightweight transaction in ScyllaDB? How can you optimize schema design to avoid wide partitions at scale?
Show more question and Answers...

Integration

Comments & Discussions