One search. Connected ideas.
Find the lesson, understand the concept, and prepare your answer.
7 results shown · grouped by type
Lessons3
A transaction makes several database operations commit or roll back as a unit. MongoDB already makes single-document writes atomic, so a transaction is mainly needed when one business rule spans multiple documents. A session supplies transaction context; every participating operation must use that context.
Read concern, write concern and read preference control different parts of consistency and availability. Read concern controls which data a read may observe, write concern controls required acknowledgement, and read preference chooses eligible replica members. Combining them deliberately matters when an application expects to read a recent write or survive failover.
Replication keeps copies of data so a system can recover from node failure, while sharding distributes different subsets of data across nodes. Replica sets improve redundancy; sharding spreads storage and workload. A sharded deployment can also replicate each shard, so these techniques are complementary.
Interview questions3
A transaction makes several database operations commit or roll back as a unit. MongoDB already makes single-document writes atomic, so a transaction is mainly needed when one business rule spans multiple documents. A session supplies transaction context; every participating operation must use that context.
Read concern, write concern and read preference control different parts of consistency and availability. Read concern controls which data a read may observe, write concern controls required acknowledgement, and read preference chooses eligible replica members. Combining them deliberately matters when an application expects to read a recent write or survive failover.
Replication keeps copies of data so a system can recover from node failure, while sharding distributes different subsets of data across nodes. Replica sets improve redundancy; sharding spreads storage and workload. A sharded deployment can also replicate each shard, so these techniques are complementary.
Modules1
MongoDB & Mongoose learning module