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
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
Databricks Free Edition講座 データサイエンス編
taka_aki
0
290
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
350
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.5k
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
110
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
73k
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.1k
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
190
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
Tebiki Engineering Team Deck
tebiki
0
24k
日本語テキストと音楽の対照学習の技術とその応用
lycorptech_jp
PRO
1
420
データの整合性を保ちたいだけなんだ
shoheimitani
8
2.9k
Featured
See All Featured
Side Projects
sachag
455
43k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Ethics towards AI in product and experience design
skipperchong
2
190
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
220
Practical Orchestrator
shlominoach
191
11k
Unsuck your backbone
ammeep
671
58k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
240
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
680
How to Talk to Developers About Accessibility
jct
2
130
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
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