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
確実に伝えるHealth通知 〜半自動システムでほどよく漏れなく / JAWS-UG 神戸 #9 神戸へようこそ!LT会
genda
0
150
Greenは本当にGreenか? - B/GデプロイとAPI自動テストで安心デプロイ
kaz29
1
130
TypeScript×CASLでつくるSaaSの認可 / Authz with CASL
saka2jp
2
140
GitHub を組織的に使いこなすために ソニーが実践した全社展開のプラクティス
sony
1
890
IPv6-mostly field report from RubyKaigi 2026
sorah
0
210
[続・営業向け 誰でも話せるOCI セールストーク] AWSよりOCIの優位性が分からない編(2025年11月21日開催)
oracle4engineer
PRO
1
130
SRE視点で振り返るメルカリのアーキテクチャ変遷と普遍的な考え
foostan
2
2.2k
単一Kubernetesクラスタで実現する AI/ML 向けクラウドサービス
pfn
PRO
1
380
スタートアップの事業成長を支えるアーキテクチャとエンジニアリング
doragt
1
8.6k
メッセージ駆動が可能にする結合の最適化
j5ik2o
9
1.6k
現地速報!Microsoft Ignite 2025 M365 Copilotアップデートレポート
kasada
2
1.8k
AI駆動開発2025年振り返りとTips集
knr109
1
120
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
420
Designing for Performance
lara
610
69k
The Language of Interfaces
destraynor
162
25k
A Tale of Four Properties
chriscoyier
162
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Practical Orchestrator
shlominoach
190
11k
Docker and Python
trallard
46
3.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
Unsuck your backbone
ammeep
671
58k
GraphQLとの向き合い方2022年版
quramy
49
14k
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