Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Concurrency + Mongo
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
gamechanger
August 21, 2012
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Concurrency + Mongo
Concurrent Operations with MongoDB
gamechanger
August 21, 2012
Transcript
12 slides
concurrency + Mongo Doug Woos engineer, gamechanger Monday, August 20,
12
Concurrency • Multiple, interacting computations • Processes modifying same or
dependent records • Relational: solved with transactions (2PC) • Mongo: no transactions (right?) • So, how do we do this? Monday, August 20, 12
Examples • Multiple users scoring one game • One user,
scoring on device, following on web • Background updates run on multiple nodes Monday, August 20, 12
atomic updates • $set, $unset, $inc, $push, $pull, $addToSet .
. . • $ operator, upserts . . . • findAndModify Monday, August 20, 12
Atomic Updates • Don’t support all operations • Schema design
important! • If we need to do a read first, can’t use Monday, August 20, 12
Isolation Queue • Do all modifications in a queue processor
• Only allow a record to be in the queue once • Compare to Java “synchronized” (monitor) Monday, August 20, 12
Isolation Queue • Part of the Dockets library • github.com/gamechanger/dockets
• Guarantees: • Updates will not conflict • Last update will be run • Intermediate updates may not be Monday, August 20, 12
Isolation Queue • Requires a queue • Not everything can
be async • Slower than Mongo atomic operators Monday, August 20, 12
Optimistic Transactions • Like Redis, sort of • Don’t lock,
but detect conflicts using save_date Monday, August 20, 12
Monday, August 20, 12
Optimistic Transactions • Single-record only • Slower than atomic updates
• Inefficient when there’s a lot of contention Monday, August 20, 12
Conclusions • Safe concurrency != ACID • Schema design is
important • No one-size-fits-all solutions in NoSQL! Monday, August 20, 12
More Decks by gamechanger
See All by gamechanger
Mongo: Performance and Troubleshooting
gamechanger
0
350
Mongo and Ops
gamechanger
0
130
Other Decks in Technology
See All in Technology
_マネジメントする人される人ナイト_2026__良いチームを作っていきたい_お気持ち_.pdf
xkxaxkx
0
800
Biohub - Cell Tracking During Development 5th place solution
rist
0
170
メール到達性を支える、リンク先URLのドメイン評価の扱い方
wind111
0
160
Context != Context: One window, many lifecycles (AI Native DevCon, Nov 2026)
birgitta410
0
160
落とし穴にハマってわかった 開発生産性を測るときに気をつけたいこと
munakata
3
410
2026-11-11 Tamachi.sre#7 PaCにインフラリソースの命を救われました。 / PaC saves the infra resource life
masasuzu
1
210
さようならSSH鍵、こんにちはゼロトラスト ― AIフレンドリーで快適な自宅鯖SSH
atalie2m
14
7.1k
CloudTrail を推したい
kazzpapa3
1
140
HTTP通信に使おうとすると実はめんどくさいfile_get_contents
maguroalternative
0
220
AWS基盤改善を支える 私たちの理念と行動指針
kentosuzuki
0
250
小さなエージェントから始めてみよう!実践コンテキストエンジニアリング
iwamot
PRO
0
130
こんなに変わった! AWSネットワークの常識
shotashiratori
16
10k
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
6.2k
4 Signs Your Business is Dying
shpigford
187
23k
How to Ace a Technical Interview
jacobian
280
24k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.8k
Become a Pro
speakerdeck
PRO
31
6.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Designing for Performance
lara
612
70k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
380
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550