Database / Apache Cassandra Intermediate and Advanced interview questions
What is SASI (SSTable Attached Secondary Index) in Cassandra?
SASI is an alternative secondary index implementation that supports query patterns the built-in 2i index cannot, most notably prefix/substring text matching and range queries on non-partition-key columns.
CREATE CUSTOM INDEX ON articles (title) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'CONTAINS'}; SELECT * FROM articles WHERE title LIKE '%cassandra%';
- Supports
LIKEqueries (prefix, suffix, and contains modes), which standard secondary indexes cannot do at all. - Supports efficient range queries (>, <) on indexed columns, unlike the equality-only built-in index.
- Index data is stored alongside each SSTable rather than in a separate system table, hence "SSTable Attached."
SASI has long carried an experimental/unsupported label in upstream Cassandra and has known issues under heavy write and compaction load, so many teams treat it cautiously and reach for external search systems (like Elasticsearch or OpenSearch) alongside Cassandra for serious full-text search needs, using SASI only for lighter-weight range or prefix lookups.
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...
