Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Concurrency + Mongo
Search
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
エンジニアリングをやめたくないので問い続ける
estie
2
1.2k
【ServiceNow SNUG Meetup LT deck】WorkFlow Editorの廃止と Flow Designerへの移行戦略
niwato
0
100
20251219 OpenIDファウンデーション・ジャパン紹介 / OpenID Foundation Japan Intro
oidfj
0
270
Identity Management for Agentic AI 解説
fujie
0
190
プロンプトやエージェントを自動的に作る方法
shibuiwilliam
15
15k
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
440
障害対応訓練、その前に
coconala_engineer
0
130
re:Invent2025 3つの Frontier Agents を紹介 / introducing-3-frontier-agents
tomoki10
0
300
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
160
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
330
生成AI時代におけるグローバル戦略思考
taka_aki
0
210
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
2
850
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
Visualization
eitanlees
150
16k
Odyssey Design
rkendrick25
PRO
0
420
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
57
37k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
400
The Invisible Side of Design
smashingmag
302
51k
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