Core Concepts & Data Models
What are the four primary NoSQL data models (Key-Value, Document, Wide-Column, Graph), and can you give a use case where one is significantly better than the others?
What is the difference between 'Horizontal Scaling' and 'Vertical Scaling,' and why is NoSQL inherently better at the former?
What is the conceptual difference between a key-value store and a document store?
What is a wide-column store, and how does its storage layout differ from a standard relational table?
Explain the 'Impedance Mismatch' problem and how NoSQL databases attempt to solve it.
In what scenarios would a graph database be more efficient than a document or relational store?
Cap & Consistency Models
Explain the CAP theorem. If a network partition occurs, why must a NoSQL database choose between Consistency and Availability? Give a real-world scenario where you would prioritize one over the other.
Compare the ACID properties of relational databases with the BASE properties of NoSQL. What does 'Soft State' and 'Eventual Consistency' mean in practice?
What exactly is 'eventual consistency'? What are the potential risks for the end-user, and how can they be mitigated at the application level?
Explain the difference between Strong, Eventual, and Causal consistency: which would you choose for a social media feed vs. a bank balance?
In the context of CAP, how do 'CP' and 'AP' databases behave differently during a network partition?
What is 'Read-Your-Writes' consistency, and how is it typically implemented in an eventually consistent system?
Explain the difference between Strong Consistency and Eventual Consistency. Give a real-world example where Eventual Consistency is acceptable.
What does 'partition tolerance' actually mean in the CAP theorem, and why is it considered non-negotiable in a distributed system?
What is the difference between data durability and consistency, and how do NoSQL databases trade them off?
How does the PACELC theorem extend CAP? Explain the trade-off between latency and consistency during normal operation when there is no partition.
Explain the concept of a quorum (R + W > N). How do you tune the number of nodes involved in a read or write to achieve strong vs. eventual consistency?
What is 'read-your-writes' consistency, and why is it challenging to achieve in a distributed NoSQL environment with multiple replicas?
What is 'monotonic read consistency', and what anomaly does it prevent?
Data Modeling & Schema Design
What is the difference between 'schema-on-read' and 'schema-on-write', and how does this affect the development lifecycle and query performance?
When designing a document store, how do you decide between embedding a child object versus referencing it by ID, and what are the impacts on read performance and write atomicity?
Explain the concept of 'Query-Driven Design' in NoSQL. How does it differ from the relational approach of normalizing data first?
Why is denormalization a first-class citizen in NoSQL, what are the risks of data duplication, and how do you handle updates to duplicated data?
How do you handle 'One-to-Many' and 'Many-to-Many' relationships in a database that doesn't support joins?
What does it mean to design 'aggregate-oriented' data, and how does that concept relate to NoSQL data modeling?
How do you handle updating denormalized/duplicated data consistently across documents, and what patterns help keep it in sync?
What is a composite or sort key, and how does it enable richer access patterns within a partition?
Explain the concept of 'Single-Table Design'. Why would someone use this pattern in a NoSQL database?
What is a materialized view in a NoSQL database, and how does it support query-driven design?
Partitioning Sharding & Scaling
What is 'Sharding' and how does it enable horizontal scalability?
Compare range-based partitioning and hash-based partitioning. Which is better for range queries, and what is the trade-off regarding data distribution?
What makes a 'good' partition key, and what happens to your system if you choose a key with low cardinality or one that creates a 'hot partition'?
What is a 'Quorum' in a distributed database, and what happens if a quorum cannot be reached during a write?
Explain 'Consistent Hashing.' How does it minimize data movement when adding or removing a node from a NoSQL cluster?
What is a 'hot partition' or 'hot key' problem, and how would you identify and resolve it through shard key selection?
What are the challenges of adding or removing nodes in a distributed NoSQL cluster, and how does the database move data without downtime?
How does a client or coordinator find which node holds a particular key in a distributed NoSQL cluster (request routing)?
Specialized Stores & Paradigms
What is object/blob storage, and how does it fit into the NoSQL/non-relational landscape?
How does TTL (time-to-live) / automatic data expiration work in NoSQL databases, and what are common use cases?
Explain the concept of polyglot persistence. Why might a modern microservices architecture use both a document store and a graph database simultaneously?
What is MapReduce as a query paradigm, and how is it used to process large datasets in NoSQL systems?
What is a time-series database, and what characteristics of NoSQL stores make them well-suited for time-series workloads?
What is a search-oriented NoSQL database (e.g., a full-text search engine), and when would you reach for one over a document store?
What is 'index-free adjacency' in a graph database, and why does it make relationship traversals fast?
How does the column-family / wide-column model handle sparse data, and why is that an advantage over fixed relational columns?
What is a ledger database, and what problem does immutability and cryptographic verification solve?
Replication & Conflict Resolution
What is 'Replication Lag', and how can it lead to 'Stale Reads' in a leader-follower architecture?
Explain the difference between Leader-based (Master-Slave) and Leaderless (Dynamo-style) replication. What are the trade-offs regarding write availability?
How does a NoSQL database handle write conflicts in a multi-leader setup? Explain 'Last-Write-Wins' vs. 'Vector Clocks'.
What are 'Vector Clocks' or 'Version Clocks', and how do they help detect causality in distributed writes?
What are CRDTs (Conflict-free Replicated Data Types) and how do they allow for automatic merging of data?
Explain 'Last-Write-Wins' (LWW). What are the dangers of relying on system clocks for conflict resolution?
What is 'read repair' and how does it help maintain consistency in a leaderless replication system?
What is 'anti-entropy', and how do background processes reconcile divergent replicas?
What is 'hinted handoff', and how does it improve write availability when a node is temporarily down?
What is a Merkle tree, and how is it used to efficiently detect and repair inconsistencies between replicas?
What is a 'sloppy quorum', and how does it differ from a strict quorum?
What is a gossip protocol, and how do nodes in a NoSQL cluster use it to share membership and state information?
Storage Engine Internals
Explain the difference between a Log-Structured Merge-Tree (LSM-Tree) and a B-Tree. Why are LSM-trees typically used in write-heavy NoSQL databases?
How do 'Secondary Indexes' work in a distributed NoSQL database, and why do they often come with a performance penalty?
What is the purpose of a Write-Ahead Log in a NoSQL storage engine, and how does it ensure durability if the system crashes before data is written to disk?
Explain the 'Compaction' process in LSM-tree-based databases. Why is it necessary for read performance?
Explain the difference between a 'Write-Optimized' and a 'Read-Optimized' storage engine.
What are 'SSTables' and 'Memtables' in the context of a NoSQL storage engine?
What is a 'Bloom Filter' and how does it improve read performance in NoSQL databases?
What is a 'tombstone' in an LSM-tree-based store, and why are deletes handled differently than in a B-tree database?
What are 'write amplification' and 'read amplification', and how do storage engine choices affect them?
Sql Vs Nosql & Distributed Transactions
When would you choose a NoSQL database over a relational one, and what are the specific trade-offs you are accepting?
What is 'Idempotency' in the context of NoSQL writes, and why is it critical for maintaining data integrity during network retries?
When would you choose a relational database over a NoSQL store, and what are the specific trade-offs regarding schema flexibility and vertical vs. horizontal scaling?
What are some common anti-patterns or situations where NoSQL is the wrong choice?
Since most NoSQL databases don't support multi-record ACID transactions, how do you handle a business process that spans multiple records? Explain the Saga pattern.
What is Two-Phase Commit (2PC), and what are its drawbacks that make it unpopular in distributed NoSQL systems?