NoSQL_Interview_Problems
NoSQL_Interview_Problems
What are the main types of NoSQL databases and how do they differ?
NoSQL databases fall into four main categories:
Document (e.g., MongoDB) — stores JSON-like documents, flexible schema.
Key-Value (e.g., Redis, DynamoDB) — simple key-value pairs, extremely fast for
lookups.
Column-Family (e.g., Cassandra, HBase) — stores data in columns for high write
throughput and wide rows.
Graph (e.g., Neo4j) — optimized for traversing and analyzing relationships.
Each type is optimized for different use cases and data access patterns.
How would you choose between MongoDB, Cassandra, and Redis for a new
system?
MongoDB:
Good for flexible documents, semi-structured data, rich querying.
Supports ACID at document level.
Cassandra:
Optimized for high-volume writes and availability.
Eventual consistency with tunable consistency levels.
Redis:
In-memory key-value store — extremely fast.
Used for caching, pub/sub, leaderboards, session storage.
Decision factors:
Access patterns (read-heavy, write-heavy, key-value vs document vs time-series).
Consistency and durability requirements.
Latency and throughput targets.