📦Key Takeaways
- 1NoSQL = Not Only SQL; includes document stores, key-value, wide-column, graph, and time-series databases
- 2NoSQL trades ACID for scalability, flexibility, and performance in specific access patterns
- 3Choose based on access pattern: key-value for simple lookups, document for flexible schema, wide-column for time-series, graph for relationships
- 4Most production systems use polyglot persistence — different databases for different needs
The NoSQL Landscape
NoSQL databases emerged to solve problems that relational databases struggle with: horizontal scaling to millions of QPS, flexible schemas that evolve without migrations, and specialized data models that match specific access patterns better than tables.
The term 'NoSQL' is misleading — it doesn't mean 'no SQL.' It means 'not only SQL.' Many NoSQL databases actually support SQL-like query languages (CQL for Cassandra, N1QL for Couchbase).
NoSQL Database Types
Simple get/set by key. Extremely fast (~100K-1M QPS). Think of it as a giant hash map.
Examples: Redis, DynamoDB, Memcached, etcd.
Use cases: Caching, session storage, feature flags, leaderboards.
Limitations: No complex queries, no joins, limited indexing.
NoSQL vs SQL Decision Matrix
| Factor | Choose SQL | Choose NoSQL |
|---|---|---|
| Data model | Highly relational, many joins | Flexible, denormalized |
| Transactions | Multi-table ACID required | Single-entity operations OK |
| Scale | <50K QPS writes | >50K QPS writes needed |
| Schema | Stable, well-defined | Evolving, varies per record |
| Query patterns | Ad-hoc, complex analytics | Known, optimized access patterns |
| Consistency | Strong consistency required | Eventual consistency acceptable |
Advantages
- •Horizontal scaling is a first-class feature
- •Flexible schemas enable rapid development
- •Optimized for specific access patterns
- •Often higher throughput than SQL for targeted workloads
Disadvantages
- •No universal query language
- •Weaker consistency guarantees
- •Denormalization leads to data duplication
- •Each type requires learning its specific data model
🧪 Test Your Understanding
Which NoSQL type is best for storing time-series data?