Database / Apache Cassandra Intermediate and Advanced interview questions
What is speculative retry in Cassandra?
Speculative retry is a per-table setting that helps tame tail latency by not letting the coordinator wait indefinitely on the single slowest replica.
- When the coordinator sends a read to the replicas needed for the consistency level, one of them may occasionally respond slowly due to GC pauses, compaction, or disk contention.
- If a response hasn't come back within a configured threshold, the coordinator speculatively sends the same read to an additional replica, and uses whichever response arrives first.
- The threshold can be a fixed time (e.g.
20ms) or a percentile of that table's observed read latency (e.g.99percentile, which adapts as the table's normal latency shifts).
ALTER TABLE orders WITH speculative_retry = '99percentile';
This trades a small amount of extra read load (occasionally querying one more replica than strictly necessary) for meaningfully better p99/p999 latency, since a single slow node no longer stalls every read that happens to be routed to it.
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...
