Tutorials System Design Mastery
NoSQL Deep Dive: When to choose MongoDB, Cassandra, or Redis
On this page
The NoSQL Landscape
"NoSQL" doesn't mean "No SQL." It stands for "Not Only SQL." They are designed for Unstructured Data and Massive Scale where traditional SQL databases struggle.
1. Document Stores (MongoDB)
Store data as JSON/BSON. Perfect for rapid development where the schema changes often. It is great for "Hierarchical" data (User profiles with many sub-objects).
2. Wide-Column Stores (Cassandra)
Designed for Extreme Write Volume. Cassandra doesn't have a master—every node is equal. It is the choice for Logging, IoT data, and Netflix-scale time-series data.
3. Key-Value Stores (Redis)
Data is stored entirely in **RAM**. It is the fastest database in the world, used for Caching, Session Management, and Leaderboards. **Architect Tip:** Remember that data in RAM is volatile—always use persistence (RDB/AOF) if you can't afford to lose the data.
4. Interview Mastery
Q: "Why would you EVER use SQL over NoSQL?"
Architect Answer: "Because SQL provides **Relationships** and **Complex Joins**. Most business logic (Banking, ERP, ERP) is naturally relational. If your data has many 'many-to-many' relationships, trying to model that in NoSQL usually leads to 'Data Duplication' and 'Data Integrity' issues. SQL is still the king of structured, high-integrity business data."
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!