How do you choose between a document store, a key-value store, a wide-column store and a graph database for a new service?
Compare key-value, document, wide-column and graph databases by access pattern: known-key lookups, aggregate documents, partition-local range reads or unbounded relationship traversal. The right NoSQL choice follows the query shape, not a generic scalability claim. It also connects cassandra to the point an interviewer is testing.
Answer
Short answer
Choose a NoSQL database from the access patterns. Use a key-value store for known-key lookups, a document database for variable aggregates loaded together, a wide-column store for partition-local ordered ranges at high write volume, and a graph database for unbounded relationship traversal. If the queries are still unknown, a relational database is often safer.
Was this answer helpful?
Likely follow-ups
- Your product manager adds a query nobody mentioned in design. What does that cost you in each of these stores?
- How would you keep two denormalised copies of the same fact consistent?
- When is a recursive CTE in PostgreSQL enough, and when do you genuinely need a graph engine?
- What operational work does a self-hosted wide-column cluster add that a managed relational instance does not?
Related questions
- You have to pick a database in the first five minutes of a design round. Which three questions decide it?mediumAlso on database-selection and access-patterns4 min
- You are building a user-profile service. Key-value store or document database: what decides it?mediumAlso on nosql4 min
- You are moving a sharded datastore to Cassandra with no maintenance window. How do you cut over, and how do you know both copies agree before you do?hardAlso on cassandra6 min
- Your service writes a record, reads it straight back, and sometimes gets the old value. What is happening and what do you change?hardAlso on nosql5 min