Database / Apache Cassandra Intermediate and Advanced interview questions
What is a snitch in Cassandra and what does it do?
A snitch tells Cassandra about the network topology — which datacenter and rack each node belongs to. This information drives two critical decisions: where to place replicas, and which replica a coordinator should prefer to talk to.
- GossipingPropertyFileSnitch: the most common production choice; each node's rack/DC is defined locally and propagated via gossip.
- Ec2Snitch / Ec2MultiRegionSnitch: automatically derive DC and rack from AWS availability zone metadata.
- SimpleSnitch: treats the cluster as one flat datacenter and rack; fine only for single-DC test setups.
With a topology-aware snitch, Cassandra's replication strategy avoids placing all replicas of a partition on the same rack, so a single rack-level outage (like a shared power or network failure) doesn't take out every copy of the data at once. The snitch also lets the coordinator prefer replicas in its own datacenter for reads, cutting cross-region latency.
Choosing the wrong snitch for your deployment (e.g. SimpleSnitch across multiple real datacenters) breaks rack/DC-aware replica placement even if NetworkTopologyStrategy is configured correctly.
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...
