Database / ScyllaDB Interview questions
What is a materialized view in ScyllaDB?
A materialized view is a server-managed table that automatically re-derives its rows from a base table using a different primary key layout, letting the same data be queried efficiently by a column that isn't part of the base table's partition key.
CREATE MATERIALIZED VIEW orders_by_status AS SELECT * FROM orders WHERE status IS NOT NULL AND customer_id IS NOT NULL AND order_id IS NOT NULL PRIMARY KEY (status, customer_id, order_id);
ScyllaDB keeps the view in sync with the base table automatically whenever the base table changes, so the application doesn't have to maintain a second table manually. The trade-off is write amplification, since every write to the base table triggers a corresponding write to each materialized view, and views are eventually consistent with the base table rather than updated in the same atomic write, which matters for applications that need strict read-after-write guarantees on the view.
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...
