SlideShare a Scribd company logo
Concurrency Internals in v2.2

           Dwight Merriman, CEO & Co-Founder, 10gen



                     This session begins at 2:45PM...

#mongosf
Version #s
vA.B.C
         Even B’s are stable
         Odd B’s are dev branch.

Current stable = 2.0.x (e.g. v2.0.4)
Current dev branch = 2.1.x (e.g. v2.1.1)
        (not for production)
        Once blessed, 2.1.x becomes v2.2.0

Thus
   1.6 -> 1.8
   1.8 -> 2.0
   2.0 -> 2.2
   2.2 -> 2.4
 are similar magnitudes of change
Two big changes in 2.2
1. Eliminate the global reader/writer lock
    “Granularization”
    First step is db-level locks.


2. PageFaultException architecture
  (yield lock on a page fault)
Lock per db
• Reader/writer lock per database
   – First step towards more granularity

• Global lock is still possible but now very rare (e.g.
  journaling locks the world for short intervals; the
  journal is shared by all dbs)

• More granularity should be fairly easy to add in the
  future – hard part is done
   – Were places in code where assumptions were made
     about exclusivity when in a write lock; those are gone
     now
Lock per db
• In v2.1.1+ sometimes two db’s are locked
  by the same thread
  – admin db for security info lookup
  – local db for replication (writing to the oplog)
Structure of a write operation
Lock(mydb);
Do_write_operation(mydb);     // slow
Lock(local_database);
Write_to_replication_oplog(); // fast
Unlock(local_database);
Unlock(mydb);
Lock status can be inspected
• currentOp()
• serverStatus()

• MMS monitoring will evolve too to help
  with instrumentation of system status in
  this regard
PageFaultException
• Improves concurrency within a single
  collection
PageFaultException




   http://blog.pythonisito.com/2011/12/mongodbs-write-lock.html
PageFaultException
• If on a write operation
  – Mutation has yet to occur
  – And we are going to page fault
• Then
  – Throw PageFaultException
  – While unlocked, touch the page
  – Retry the operation
The Future
•   More granularity
•   Now that there is some, much easier
•   Collection level for sure
•   Document level locking (latching) – there
    are some nuances (btrees) – but at least
    directionally, yes
Thanks


 Please help us test the upcoming v2.2 release by hammering the dev branch releases in your
 QA environment (i.e., v2.1.1).




Next :

More Related Content

What's hot (20)

ODP
Getting hands on-experience with UltraESB
AdroitLogic
 
PPTX
Google File Systems
Azeem Mumtaz
 
PDF
Elastic jenkins
Daniel Barker
 
PPTX
Replay your workload as it is your actual one!
Boris Hristov
 
PDF
7 Ways To Crash Postgres
PostgreSQL Experts, Inc.
 
PDF
Node
Arjun Raj
 
PDF
From One to a Cluster
guestd34230
 
PDF
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Rajni Baliyan
 
PDF
OSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
NETWAYS
 
PPTX
How to Install and Use MMS
MongoDB
 
PDF
Mongo performance tuning: tips and tricks
Vladimir Malyk
 
PDF
NodeJS ecosystem
Yukti Kaura
 
PDF
Using ZFS file system with MySQL
Mydbops
 
PPTX
NodeJs Session02
Jainul Musani
 
PPTX
MySQL Replication Overview -- PHPTek 2016
Dave Stokes
 
PDF
Managing a lot of servers
Marian Marinov
 
PDF
Replay your workload as it is your actual one!
Boris Hristov
 
PDF
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE
 
PDF
Node.js concurrency
Giacomo Fornari
 
PDF
Adminblast 2013
Gabriella Davis
 
Getting hands on-experience with UltraESB
AdroitLogic
 
Google File Systems
Azeem Mumtaz
 
Elastic jenkins
Daniel Barker
 
Replay your workload as it is your actual one!
Boris Hristov
 
7 Ways To Crash Postgres
PostgreSQL Experts, Inc.
 
Node
Arjun Raj
 
From One to a Cluster
guestd34230
 
Basics of Logical Replication,Streaming replication vs Logical Replication ,U...
Rajni Baliyan
 
OSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
NETWAYS
 
How to Install and Use MMS
MongoDB
 
Mongo performance tuning: tips and tricks
Vladimir Malyk
 
NodeJS ecosystem
Yukti Kaura
 
Using ZFS file system with MySQL
Mydbops
 
NodeJs Session02
Jainul Musani
 
MySQL Replication Overview -- PHPTek 2016
Dave Stokes
 
Managing a lot of servers
Marian Marinov
 
Replay your workload as it is your actual one!
Boris Hristov
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE
 
Node.js concurrency
Giacomo Fornari
 
Adminblast 2013
Gabriella Davis
 

Viewers also liked (9)

PPTX
Deconstructing Data Breach Cost
Resilient Systems
 
PPTX
How Thermo Fisher Is Reducing Mass Spectrometry Experiment Times from Days to...
MongoDB
 
PPTX
Maximizing MongoDB Performance on AWS
MongoDB
 
PDF
MongoDB World 2016: Poster Sessions eBook
MongoDB
 
PPTX
How Auto Trader enables the UK's largest digital automotive marketplace
MongoDB
 
PPTX
Webinar: Transitioning from SQL to MongoDB
MongoDB
 
PDF
The importance of efficient data management for Digital Transformation
MongoDB
 
PDF
The Rise of Microservices
MongoDB
 
PDF
Creating a Modern Data Architecture for Digital Transformation
MongoDB
 
Deconstructing Data Breach Cost
Resilient Systems
 
How Thermo Fisher Is Reducing Mass Spectrometry Experiment Times from Days to...
MongoDB
 
Maximizing MongoDB Performance on AWS
MongoDB
 
MongoDB World 2016: Poster Sessions eBook
MongoDB
 
How Auto Trader enables the UK's largest digital automotive marketplace
MongoDB
 
Webinar: Transitioning from SQL to MongoDB
MongoDB
 
The importance of efficient data management for Digital Transformation
MongoDB
 
The Rise of Microservices
MongoDB
 
Creating a Modern Data Architecture for Digital Transformation
MongoDB
 
Ad

Similar to MongoSF: MongoDB Concurrency Internals in v2.2 (20)

PDF
Racing The Web - Hackfest 2016
Aaron Hnatiw
 
PPT
Concurrency (Distributed computing)
Sri Prasanna
 
PDF
Eventdriven I/O - A hands on introduction
Marc Seeger
 
PPTX
CS 542 -- Concurrency Control, Distributed Commit
J Singh
 
PDF
7 concurrency controltwo
ashish61_scs
 
PDF
7 concurrency controltwo
ashish61_scs
 
PDF
Module 5 part-2 concurrency control in dbms
barekaresahana
 
PPTX
UNIT IV DIS.pptx
Premkumar R
 
PDF
Transactions and Concurrency Control Patterns - 2019
Vlad Mihalcea
 
PPTX
Transaction management transparencies
Mohamed Zeinelabdeen Abdelgader Farh jber
 
PPTX
L12 Concurrent Programming
Ólafur Andri Ragnarsson
 
PPTX
Optimistic concurrency control in Distributed Systems
mridul mishra
 
PPTX
2 con control
Mr Patrick NIYISHAKA
 
PDF
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (SQL Saturday M...
Bob Pusateri
 
PDF
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (Chicago Suburb...
Bob Pusateri
 
KEY
NoSQL Databases: Why, what and when
Lorenzo Alberton
 
PDF
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
alemunuruhak9
 
PPTX
osi-oss-dbs.pptx
Shivji Kumar Jha
 
PPTX
ReadConcern and WriteConcern
MongoDB
 
PDF
PostgreSQL 9.5 - Major Features
InMobi Technology
 
Racing The Web - Hackfest 2016
Aaron Hnatiw
 
Concurrency (Distributed computing)
Sri Prasanna
 
Eventdriven I/O - A hands on introduction
Marc Seeger
 
CS 542 -- Concurrency Control, Distributed Commit
J Singh
 
7 concurrency controltwo
ashish61_scs
 
7 concurrency controltwo
ashish61_scs
 
Module 5 part-2 concurrency control in dbms
barekaresahana
 
UNIT IV DIS.pptx
Premkumar R
 
Transactions and Concurrency Control Patterns - 2019
Vlad Mihalcea
 
Transaction management transparencies
Mohamed Zeinelabdeen Abdelgader Farh jber
 
L12 Concurrent Programming
Ólafur Andri Ragnarsson
 
Optimistic concurrency control in Distributed Systems
mridul mishra
 
2 con control
Mr Patrick NIYISHAKA
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (SQL Saturday M...
Bob Pusateri
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (Chicago Suburb...
Bob Pusateri
 
NoSQL Databases: Why, what and when
Lorenzo Alberton
 
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
alemunuruhak9
 
osi-oss-dbs.pptx
Shivji Kumar Jha
 
ReadConcern and WriteConcern
MongoDB
 
PostgreSQL 9.5 - Major Features
InMobi Technology
 
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
 

Recently uploaded (20)

PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Python Conference Singapore - 19 Jun 2025
ninefyi
 
PPTX
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PDF
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Python Conference Singapore - 19 Jun 2025
ninefyi
 
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Kubernetes - Architecture & Components.pdf
geethak285
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 

MongoSF: MongoDB Concurrency Internals in v2.2

  • 1. Concurrency Internals in v2.2 Dwight Merriman, CEO & Co-Founder, 10gen This session begins at 2:45PM... #mongosf
  • 2. Version #s vA.B.C Even B’s are stable Odd B’s are dev branch. Current stable = 2.0.x (e.g. v2.0.4) Current dev branch = 2.1.x (e.g. v2.1.1) (not for production) Once blessed, 2.1.x becomes v2.2.0 Thus 1.6 -> 1.8 1.8 -> 2.0 2.0 -> 2.2 2.2 -> 2.4 are similar magnitudes of change
  • 3. Two big changes in 2.2 1. Eliminate the global reader/writer lock “Granularization” First step is db-level locks. 2. PageFaultException architecture (yield lock on a page fault)
  • 4. Lock per db • Reader/writer lock per database – First step towards more granularity • Global lock is still possible but now very rare (e.g. journaling locks the world for short intervals; the journal is shared by all dbs) • More granularity should be fairly easy to add in the future – hard part is done – Were places in code where assumptions were made about exclusivity when in a write lock; those are gone now
  • 5. Lock per db • In v2.1.1+ sometimes two db’s are locked by the same thread – admin db for security info lookup – local db for replication (writing to the oplog)
  • 6. Structure of a write operation Lock(mydb); Do_write_operation(mydb); // slow Lock(local_database); Write_to_replication_oplog(); // fast Unlock(local_database); Unlock(mydb);
  • 7. Lock status can be inspected • currentOp() • serverStatus() • MMS monitoring will evolve too to help with instrumentation of system status in this regard
  • 8. PageFaultException • Improves concurrency within a single collection
  • 9. PageFaultException http://blog.pythonisito.com/2011/12/mongodbs-write-lock.html
  • 10. PageFaultException • If on a write operation – Mutation has yet to occur – And we are going to page fault • Then – Throw PageFaultException – While unlocked, touch the page – Retry the operation
  • 11. The Future • More granularity • Now that there is some, much easier • Collection level for sure • Document level locking (latching) – there are some nuances (btrees) – but at least directionally, yes
  • 12. Thanks Please help us test the upcoming v2.2 release by hammering the dev branch releases in your QA environment (i.e., v2.1.1). Next :