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

What's hot (20)

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

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

PDF
MongoDB World 2018: Building a New Transactional Model
MongoDB
 
PPTX
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...
MongoDB
 
PDF
MongoDB.pdf
KuldeepKumar778733
 
PDF
Introduction to MongoDB
Mike Dirolf
 
KEY
MongoDB
Steven Francia
 
PPTX
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
Jason Terpko
 
PPT
MongoDB Pros and Cons
johnrjenson
 
PPTX
MongoDB 3.0
Victoria Malaya
 
PDF
MongoDB at FrozenRails
Mike Dirolf
 
PPTX
Agility and Scalability with MongoDB
MongoDB
 
PDF
Building Apps with MongoDB
Nate Abele
 
KEY
Mongodb intro
christkv
 
PPTX
Mongo db intro.pptx
JWORKS powered by Ordina
 
KEY
MongoDB Administration 20110922
radiocats
 
PDF
Use Your MySQL Knowledge to Become a MongoDB Guru
Tim Callaghan
 
PPTX
MongoDB
nikhil2807
 
PPT
Introduction to MongoDB
Ravi Teja
 
PPTX
MongoDB 3.2 - a giant leap. What’s new?
Binary Studio
 
PPTX
Neue Features in MongoDB 3.6
MongoDB
 
PPTX
MongoDB 2.4 and spring data
Jimmy Ray
 
MongoDB World 2018: Building a New Transactional Model
MongoDB
 
MongoDB.local Sydney: How and When to Use Multi-Document Distributed Transact...
MongoDB
 
MongoDB.pdf
KuldeepKumar778733
 
Introduction to MongoDB
Mike Dirolf
 
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
Jason Terpko
 
MongoDB Pros and Cons
johnrjenson
 
MongoDB 3.0
Victoria Malaya
 
MongoDB at FrozenRails
Mike Dirolf
 
Agility and Scalability with MongoDB
MongoDB
 
Building Apps with MongoDB
Nate Abele
 
Mongodb intro
christkv
 
Mongo db intro.pptx
JWORKS powered by Ordina
 
MongoDB Administration 20110922
radiocats
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Tim Callaghan
 
MongoDB
nikhil2807
 
Introduction to MongoDB
Ravi Teja
 
MongoDB 3.2 - a giant leap. What’s new?
Binary Studio
 
Neue Features in MongoDB 3.6
MongoDB
 
MongoDB 2.4 and spring data
Jimmy Ray
 
Ad

More from MongoDB (20)

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

Recently uploaded (20)

PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 

A New Transactional Model - Keith Bostic