Database / Apache Cassandra Intermediate and Advanced interview questions
How does Cassandra detect node failure?
Cassandra uses a Phi Accrual Failure Detector rather than a simple fixed heartbeat timeout to decide whether a node is up or down.
- Each node tracks the history of arrival times of heartbeats (via gossip) from every other node.
- From that history it builds a statistical distribution of expected inter-arrival times.
- Instead of a hard yes/no cutoff, it computes a suspicion level (phi) — the higher phi climbs, the more confident the detector is that the node is actually down rather than just slow.
- A configurable threshold (
phi_convict_threshold) decides when a node is finally marked down.
This approach adapts to each node's normal network conditions: a node on a congested link with naturally jittery heartbeats won't be falsely marked down as quickly as a fixed timeout would cause, while a consistently punctual node gets flagged fast if it truly goes silent.
Failure detection only marks a node down locally and informs the rest of the cluster via gossip — it does not by itself trigger any data movement; that is handled separately by hinted handoff and repair.
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...
