SlideShare a Scribd company logo
MongoDB:
A New Transactional Model
keith.bostic@mongodb.com
KEITH BOSTIC
Distinguished Engineer,
MongoDB
keith.bostic@mongodb.com
Review & Motivations
Relational vs document data models
Goals: performance and complexity
Goals: new applications, programmer
models
Goals: checkboxes and vendor lock-in
Application
developers our
focus
But not our only audience
“ACID transactions are a key capability for
business critical transactional systems,
specifically around commerce processing.
No other database has both the power of
NoSQL and cross collection ACID
transaction support. This combination will
make it easy for developers to write
mission critical applications leveraging the
power of MongoDB.”
– Dharmesh Panchmatia,
Director of E-commerce, Cisco Systems
ACID
Transactions: Acid
Transactions: aCid
Detour:
Consistency, Availability, Partition
tolerance
C
PA
Transactions: acId
Transactions: aciD
MongoDB World talk!
Transactions and Durability:
Putting the “D” in ACID
– Sue LoVerso, Senior Engineer, MongoDB
The Path
Multi-year, all-hands company effort
• The storage layer,
Multi-year, all-hands company effort
• The storage layer,
• Sharding architecture,
Multi-year, all-hands company effort
• The storage layer,
• Sharding architecture,
• Introducing a global logical
clock,
Multi-year, all-hands company effort
• The storage layer,
• Sharding architecture,
• Introducing a global logical
clock,
• New replication consensus
protocol,
Multi-year, all-hands company effort
• The storage layer,
• Sharding architecture,
• Introducing a global logical
clock,
• New replication consensus
protocol,
• Metadata management,
… and that’s just part of the
list!
Multi-year, all-hands company effort
• The storage layer,
• Sharding architecture,
• Introducing a global logical clock,
• New replication consensus
protocol,
• Metadata management,
… and that’s just part of the list!
• Not forgetting the driver teams,
documentation and education.
MongoDB 2.6: mmapv1 with ACID
2.6
P
S
S
S
Detour: the storage engine
The storage engine is part of the MongoDB database server.
Think of it as “owning” the data.
networking, sharding, replication, drivers
analytics, middleware, query optimizer
storage engine
You
are
here.
Detour: the storage engine
Single
Node
MongoDB’s pluggable storage architecture
• MMAPv1
• RocksDB (Facebook)
• TokuMX (TokuTek)
• WiredTiger
MongoDB 3.0: a new storage engine
F Keys &
Values
E Keys &
Values
G Keys &
Values
Write-heavy workloads
Document level locking
Compaction
Encryption
Compression
In-Memory
2.6 3.0
B-D
Keys
E-I
Keys
J-N
Keys
MongoDB 3.0: transactional features
2.6 3.0
MongoDB 3.2
P
S
S
S
“majority” writes
readConcern
2.6 3.0 3.2
MongoDB 3.4
2.6 3.0 3.43.2
MongoDB 3.6: transactional features
P
S
S
S
logical sessions
global clock (Lamport)
… leads to causal consistency
2.6 3.0 3.63.43.2
MongoDB 3.6: enhanced consistency
P
S
S
S
consistent secondary reads
retryable writes
read concern majority
2.6 3.0 3.63.43.2
MongoDB University video
Implementation of Cluster-
Wide Causal Consistency in
MongoDB
– Misha Tyulenev, Engineer, MongoDB
MongoDB 4.0: multi-document transactions
P
S
S
S
2.6 3.0 3.63.43.2 4.0
MongoDB 4.0: prepared transactions
Commit?
Yes
Yes
Commit!
Phase One Phase Two
2.6 3.0 3.63.43.2 4.0
MongoDB 4.X
P
S
S
S
PS
S
2.6 3.0 3.63.43.2 4.0 4.X
MongoDB World talk!
What’s Next? The Path to
Sharded Transactions
– Andy Schwerin, VP, Engineering, MongoDB
Why is this work hard?
Reason #1: single-node vs. group ordering
WiredTigerMongoDB
Replication example
... 37 38 39
... 37 38 39
... 37 38 39
... 37 38 39
Primary Oplog
Secondary reads
“People assume that time is a strict
progression of cause to effect, but
actually, from a non-linear, non-
subjective point of view, it is more
like a big ball of wibbily-wobbly
timey-wimey … stuff.”
– Doctor Who
Multi-threaded secondary oplog application
... 37 38 39 40 4241
Primary oplog order
Secondary apply order
40 39 41 38
OpLog
Reason #2: increasing entanglement
Getting the right answer requires communication.
C
PA
Timestamps
MongoDB’s timestamp
... 40 4138 39 42
ACID for a set of systems
durability based on replication
WiredTiger’s transaction ID
... 40 4138 39 42
ACID for a single-node
durability based on checkpoints and journaling
MongoDB timestamp overrides
WiredTiger ID
64-bit value
fast comparisons
strictly increasing
MSB hex string API
Timestamp stored with each MVCC update
FRUIT
mango
apple
banana
TXN ID
TIMESTAMP
Multi-threaded secondary oplog application
... 37 38 39 40 4241
Primary oplog order
Secondary timestamp order
... 37 38 39 40 4241
Set the timestamp at update or commit
OpLog
Overlapping reads with oplog application
Secondary timestamp order
... 37 38 39 40 4241
Timestamp #1 Timestamp #2
3.6
4.0
Blocking
Parallel
Queries can be “as of” a timestamp
set at transaction begin
largest LTE value
We need an “oldest” timestamp
Durability can be “as of” a timestamp
Replication rollback for a single server
... 37 38 39 40 4241
Primary Oplog
... 37 38 39 117 119118
Corrected (Secondary) Oplog
Replacements
We need a “stable” timestamp
Sydney & New York
KEITH BOSTIC
Distinguished Engineer,
MongoDB
Keith.bostic@mongodb.com

More Related Content

PPTX
MongoDB Atlas
PDF
MongoDB .local Toronto 2019: MongoDB Atlas Jumpstart
PDF
MongoDB Europe 2016 - Star in a Reasonably Priced Car - Which Driver is Best?
PDF
MongoDB .local Toronto 2019: MongoDB – Powering the new age data demands
PPTX
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
PPTX
eHarmony - Messaging Platform with MongoDB Atlas
PPTX
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
PDF
MongoDB .local Chicago 2019: A MongoDB Journey: Moving from a relational data...
MongoDB Atlas
MongoDB .local Toronto 2019: MongoDB Atlas Jumpstart
MongoDB Europe 2016 - Star in a Reasonably Priced Car - Which Driver is Best?
MongoDB .local Toronto 2019: MongoDB – Powering the new age data demands
MongoDB 3.4: Deep Dive on Views, Zones, and MongoDB Compass
eHarmony - Messaging Platform with MongoDB Atlas
How Thermo Fisher is Reducing Data Analysis Times from Days to Minutes with M...
MongoDB .local Chicago 2019: A MongoDB Journey: Moving from a relational data...

What's hot (20)

PPTX
Blockchain Hyper Ledger Fabric : Bangkok Conference
PPTX
Introducing MongoDB Atlas
PPTX
Secure, Low Latency with MongoDB
PPTX
Webinar: Compliance and Data Protection in the Big Data Age: MongoDB Security...
PPTX
Webinar: Simplifying the Database Experience with MongoDB Atlas
PDF
MongoDB .local Munich 2019: Mastering MongoDB on Kubernetes – MongoDB Enterpr...
PDF
MongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB World 2019: Ticketek: Scaling to Global Ticket Sales with MongoDB Atlas
PDF
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
PDF
MongoDB World 2019: MongoDB in Data Science: How to Build a Scalable Product ...
PDF
MongoDB Atlas Workshop - Singapore
PPTX
MongoDB and Spark
PDF
Overcoming Today's Data Challenges with MongoDB
PDF
From RDBMS to MongoDB
PPTX
Sizing Your MongoDB Cluster
PDF
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
PDF
Spark and MongoDB
PPTX
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
PPTX
A Free New World: Atlas Free Tier and How It Was Born
PDF
MongoDB .local Toronto 2019: Finding the Right Atlas Cluster Size: Does this ...
Blockchain Hyper Ledger Fabric : Bangkok Conference
Introducing MongoDB Atlas
Secure, Low Latency with MongoDB
Webinar: Compliance and Data Protection in the Big Data Age: MongoDB Security...
Webinar: Simplifying the Database Experience with MongoDB Atlas
MongoDB .local Munich 2019: Mastering MongoDB on Kubernetes – MongoDB Enterpr...
MongoDB .local Chicago 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB World 2019: Ticketek: Scaling to Global Ticket Sales with MongoDB Atlas
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
MongoDB World 2019: MongoDB in Data Science: How to Build a Scalable Product ...
MongoDB Atlas Workshop - Singapore
MongoDB and Spark
Overcoming Today's Data Challenges with MongoDB
From RDBMS to MongoDB
Sizing Your MongoDB Cluster
MongoDB .local Bengaluru 2019: Using MongoDB Services in Kubernetes: Any Plat...
Spark and MongoDB
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
A Free New World: Atlas Free Tier and How It Was Born
MongoDB .local Toronto 2019: Finding the Right Atlas Cluster Size: Does this ...
Ad

Similar to A New Transactional Model - Keith Bostic (20)

PDF
MongoDB World 2018: Building a New Transactional Model
PPTX
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
PDF
MongoDB Europe 2016 - Powering Microservices with Docker, Kubernetes, and Kafka
PPTX
How Thermo Fisher Is Reducing Mass Spectrometry Experiment Times from Days to...
PPTX
Novedades de MongoDB 3.6
PPTX
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
PPTX
L’architettura di Classe Enterprise di Nuova Generazione
PDF
Making your Life Easier with MongoDB and Kafka (Robert Walters, MongoDB) Kafk...
PDF
Consistent join queries in cloud data stores
PPT
MongoDB Tick Data Presentation
PPTX
Webinar: What's New in MongoDB 3.2
PPT
Webinar: High Performance MongoDB Applications with IBM POWER8
PPTX
L’architettura di classe enterprise di nuova generazione
PPTX
Data Streaming with Apache Kafka & MongoDB
PPTX
How sitecore depends on mongo db for scalability and performance, and what it...
PPTX
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
PPTX
mongoDB: Driving a data revolution
PPTX
Monogo db in-action
PDF
Webinar: Data Streaming with Apache Kafka & MongoDB
PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB World 2018: Building a New Transactional Model
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
MongoDB Europe 2016 - Powering Microservices with Docker, Kubernetes, and Kafka
How Thermo Fisher Is Reducing Mass Spectrometry Experiment Times from Days to...
Novedades de MongoDB 3.6
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
L’architettura di Classe Enterprise di Nuova Generazione
Making your Life Easier with MongoDB and Kafka (Robert Walters, MongoDB) Kafk...
Consistent join queries in cloud data stores
MongoDB Tick Data Presentation
Webinar: What's New in MongoDB 3.2
Webinar: High Performance MongoDB Applications with IBM POWER8
L’architettura di classe enterprise di nuova generazione
Data Streaming with Apache Kafka & MongoDB
How sitecore depends on mongo db for scalability and performance, and what it...
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
mongoDB: Driving a data revolution
Monogo db in-action
Webinar: Data Streaming with Apache Kafka & MongoDB
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
PDF
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB

Recently uploaded (20)

PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Essential Infomation Tech presentation.pptx
PDF
AI in Product Development-omnex systems
PDF
System and Network Administraation Chapter 3
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
L1 - Introduction to python Backend.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Digital Strategies for Manufacturing Companies
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
medical staffing services at VALiNTRY
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Odoo Companies in India – Driving Business Transformation.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Essential Infomation Tech presentation.pptx
AI in Product Development-omnex systems
System and Network Administraation Chapter 3
Upgrade and Innovation Strategies for SAP ERP Customers
L1 - Introduction to python Backend.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Digital Strategies for Manufacturing Companies
Reimagine Home Health with the Power of Agentic AI​
CHAPTER 2 - PM Management and IT Context
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
medical staffing services at VALiNTRY
Which alternative to Crystal Reports is best for small or large businesses.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PTS Company Brochure 2025 (1).pdf.......
Odoo Companies in India – Driving Business Transformation.pdf

A New Transactional Model - Keith Bostic