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
2011-MongoDC-Storage.pdf
Search
mongodb
July 12, 2011
Programming
180
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
2011-MongoDC-Storage.pdf
mongodb
July 12, 2011
More Decks by mongodb
See All by mongodb
NoSQL Now! 2012
mongodb
18
3.4k
MongoDB 2.2 At the Silicon Valley MongoDB User Group
mongodb
9
1.5k
Turning off the LAMP Hunter Loftis, Skookum Digital Works
mongodb
2
1.6k
Mobilize Your MongoDB! Developing iPhone and Android Apps in the Cloud Grant Shipley, Red Hat
mongodb
0
590
Beanstalk Data - MongoDB In Production Chris Siefken, CTO Beanstalk Data
mongodb
0
590
New LINQ support in C#/.NET driver Robert Stam, 10gen
mongodb
9
41k
Welcome and Keynote Aaron Heckman, 10gen
mongodb
0
560
Webinar Introduction to MongoDB's Java Driver
mongodb
1
1.3k
Webinar Intro to Schema Design
mongodb
4
1.8k
Other Decks in Programming
See All in Programming
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
160
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5k
AHC070解法紹介
eijirou
0
130
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
3.7k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
4
12k
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
570
Agents on Rails - Rails at Scale 2026
irinanazarova
0
210
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
370
Java 27新機能 / Java 27 new features
kishida
2
170
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
470
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
2
300
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
Design in an AI World
tapps
1
330
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
250
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
850
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
310
WENDY [Excerpt]
tessaabrams
14
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Spectacular Lies of Maps
axbom
PRO
1
1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.9k
Transcript
Eliot Horowitz @eliothorowitz MongoDC June 27, 2011 Storage and Journalling
Directory Layout -rw------- 1 erh admin 64M Jun 26 00:15
test.0 -rw------- 1 erh admin 128M Jun 21 00:20 test.1 -rw------- 1 erh admin 256M Jun 26 00:15 test.2 -rw------- 1 erh admin 512M Jun 21 00:20 test.3 -rw------- 1 erh admin 1.0G Jun 26 00:15 test.4 -rw------- 1 erh admin 2.0G Jun 25 23:08 test.5 -rw------- 1 erh admin 16M Jun 26 00:15 test.ns •Separate files per database •Aggressive preallocation •Always spare file
Internal File Format • Files broken into extents • A
collection has 1 to many extents • Grow exponentially up to 2gb (max file size as well) • Indexes have different extents than data
Sample Extents > db.foo.validate( { full : true } ).extents.forEach(
function(z){ print( z.loc + "\t\t" + z.size ); } ) 0:3000 20480 0:12000 81920 0:26000 327680 0:76000 1310720 0:1da000 5242880 0:76a000 6291456 0:d6a000 7553024 0:16de000 9064448 0:1f83000 10878976 0:29e3000 13058048 1:2000 15671296 1:ef4000 18808832 1:29e4000 22573056 1:3f6b000 27090944 1:5941000 32509952
Index Extents > db.system.namespaces.find() { "name" : "test2.foo" } {
"name" : "test2.system.indexes" } { "name" : "test2.foo.$_id_" } > db["foo.$_id_"].validate( { full : true } ).extents.forEach( function(z){ print( z.loc + "\t\t" + z.size ); } ) 0:9000 36864 0:1b6000 147456 0:6da000 589824 0:149e000 2359296 1:20e4000 9437184
Memory Mapped • All data files memory mapped • Virtual
size = total data size + overhead • Journaled virtual size = ( total data size * 2 ) + overhead • fsync every 60 seconds (--syncdelay)
Journalling • Write ahead log • Operations written to journal
before memory mapped regions • Once journal written, data safe unless hardware problem
When is Data Written • Journal flushed every 100ms or
100mb written • j=true flag to force a journal flush
Journal Admin • /journal sub directory in <dbpath> (/data/ db)
• 3 1gb files that get rotated • Can symlink to a different spindle
Performance • On 99.9% read systems, no impact • Write
performance 5-30% slowdown on same drive • Using separate drive as low as 3%
When to use • Single node - required for any
data integrity • Replica Set - at least 1 node • All nodes for large data sets removes need for large resyncs
Fragmentation • Files can get fragmented over time if documents
change size • Need to improve free list
Compacting • 1.8 and previous: repairDatabase • 2.0+ : compact
command
drop/dropDatabase • drop: frees extents, not data files • dropDatabase:
frees files
update and moves • Updates can make documents bigger •
Moves are more expensive than other operations
padding • adaptive padding between 1.0 and 2.0 • manual
control coming
Download MongoDB http://www.mongodb.org and let us know what you think
@eliothorowitz @mongodb 10gen is hiring! http://www.10gen.com/jobs