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
How MongoDB Works
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Uladzimir Mihura
February 01, 2013
Technology
260
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How MongoDB Works
Deck for a short talk I've given on a EPAM Software Engineering Conference 2013.
Uladzimir Mihura
February 01, 2013
More Decks by Uladzimir Mihura
See All by Uladzimir Mihura
What is to be a senior engineer?
trnl
1
380
Apache Cassandra
trnl
2
250
Other Decks in Technology
See All in Technology
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
250
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
古い指輪から広がった JAVA コミュニティ とのつながり
yamad
0
110
夫婦で子育てするための育児標準化
codmoninc
PRO
0
350
20261017福岡devIO 「AIは"良いダッシュボード"を作れるか?
jtakeda
0
160
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
140
Browser Spec: Testing Hotwire with Ruby
takahashim
1
120
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
240
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
1
210
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.6k
Raft: Consensus for Rubyists
vanstee
142
7.8k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Design in an AI World
tapps
1
350
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
600
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Transcript
How MongoDB works Uladzimir Mihura Senior Software Engineer, EPAM Systems
Software Engineering Conference 2013
Data Model {name:'mongo', type:'DB'}
Data Model: Document oriented { _id: 1, name:
{ first: 'Michael', last: 'Faraday' }, birth: new Date('Sep 22, 1791'), death: new Date('Aug 25, 1867'), contribs: ['Chemistry', 'Electricity', 'Diamagnetism'] }
{ hello: 'SEC 2013'} \x19\x00\x00\x00 \x02hello \x09\x00\x00\x00 SEC 2013\x00 Data
Model: BSON
Data Model: Structure Document Collection Database MongoDB Instance
db.foo.find({name:'Niels', surname:'Bohr'}) Reading
• find, findOne • accepts a conditions object • regex,
strings, numbers, etc... • rich operators • $lt, $gt, $or, $and, $in, $ne, ... • projections • specify fields to return Reading: Dynamic Queries
Reading: Indexes • B-Tree • multiply fields • options •
unique • sparse • 2d • full text search (≥2.4) Di Lu Rh B C Cr Zo St Sa Ka H F B C Cr
Reading: Query Optimizer x x remember db.foo.find({ x: 10, y:'bar'})
index on y index on x full scan
Writing db.foo.insert({name:'Georg', surname:'Ohm'})
• Errors ignored (even network errors) • Unacknowledged (fire &
forget) • Acknowledged (write accepted) • Journaled • Propagated to the replica set members Writing: Write Concerns
Writing: Isolation db.foo.update( { field1 : 1 , $isolated
: 1 }, { $inc : { field2 : 1 } } , { multi: true } )
Storage Management {name:'mongo', type:'DB'}
Storage: Padding factor ... Padding Header BSON Data Padding Header
...
Storage: Directory Layout -‐rw-‐-‐-‐-‐-‐-‐-‐ 1 trnl trnl
64M Jan 28 14:38 foo.0 -‐rw-‐-‐-‐-‐-‐-‐-‐ 1 trnl trnl 128M Jan 28 14:26 foo.1 -‐rw-‐-‐-‐-‐-‐-‐-‐ 1 trnl trnl 256M Jan 28 14:31 foo.2 -‐rw-‐-‐-‐-‐-‐-‐-‐ 1 trnl trnl 512M Jan 28 14:38 foo.3 -‐rw-‐-‐-‐-‐-‐-‐-‐ 1 trnl trnl 1.0G Jan 28 14:38 foo.4 -‐rw-‐-‐-‐-‐-‐-‐-‐ 1 trnl trnl 2.0G Jan 28 14:38 foo.5 -‐rw-‐-‐-‐-‐-‐-‐-‐ 1 trnl trnl 16M Jan 28 14:38 foo.ns • Separate files per database • Aggressive preallocation
Storage: Memory mapped files foo.1 foo.2 foo.3 ... foo.n Virtual
Memory
Scaling {name:'mongo', type:'DB'}
Scaling: Replication Node 3 Primary Node 1 Secondary Node 2
Secondary Replication Replication client read read read write
Scaling: Replication Node 3 Primary Node 1 Primary Node 2
Secondary Replication client read read write
Scaling: Replication Node 3 Secondary Node 1 Primary Node 2
Secondary Replication client read read write read Replication
Scaling: Sharding Client mongos mongos ... mongod mongod mongod Replica
Set mongod mongod mongod Replica Set mongod mongod mongod Replica Set Shards mongod mongod mongod Config Servers
MongoDB Drivers Team @ 10gen
• MongoLab.com • MongoHQ.com • HostedMongo.com • MongoMachine.com • ObjectRocket
• etc Hosted Solutions
Thank you. Let’s ask. http://try.mongodb.org/ http://on.fb.me/bymongo/