Database / ScyllaDB Interview questions
Define a partition key in ScyllaDB?
A partition key is the portion of a table's primary key that determines which node(s) store a given row, by hashing the key value into a token that maps to a range owned by a specific replica set. Every row with the same partition key lands in the same partition, physically together on disk.
CREATE TABLE sensor_readings ( sensor_id text, reading_time timestamp, value double, PRIMARY KEY (sensor_id, reading_time) );
Here sensor_id is the partition key: all readings for one sensor are stored together and can be read efficiently as a range. Choosing a partition key with high cardinality and even access patterns is critical, since a key with too few distinct values, or one that concentrates traffic, creates an oversized or overloaded partition that a single set of replicas must absorb.
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...
