Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
0
110
Concurrency + Mongo
Concurrent Operations with MongoDB
gamechanger
August 21, 2012
Tweet
Share
More Decks by gamechanger
See All by gamechanger
Mongo: Performance and Troubleshooting
gamechanger
0
310
Mongo and Ops
gamechanger
0
120
Other Decks in Technology
See All in Technology
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
What happened to RubyGems and what can we learn?
mikemcquaid
0
250
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
300
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.2k
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
270
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
150
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
190
Agile Leadership Summit Keynote 2026
m_seki
1
560
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
140
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
350
Webhook best practices for rock solid and resilient deployments
glaforge
1
280
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Music & Morning Musume
bryan
47
7.1k
Skip the Path - Find Your Career Trail
mkilby
0
53
Navigating Weather and Climate Data
rabernat
0
100
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.9k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
180
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Transcript
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