20. 2.0 Setup
NYC SFO
Shard1 Primary Secondary
Shard2 Primary Secondary
My Writes My Reads
Boston 8ms 8ms
Chicago 23ms 23ms
Los Angeles 83ms 83ms
Paris 133ms 133ms
Tokyo 174ms 174ms
22. 2.2 Setup
SFO NYC Tag
Shard1 Primary Secondary SFO
Shard2 Secondary Primary NYC
country region tag
USA CA SFO
USA FL NYC
USA CA SFO
23. My Writes My Reads
Boston 8ms 8ms
Chicago 23ms 23ms
Los Angeles 10ms 10ms
Paris 133ms 133ms
Tokyo 95ms 95ms
24. 2.2 Setup
SFO NYC Amsterdam Tokyo Tag
Shard1 Primary Secondary SFO
Shard2 Secondary Primary NYC
Shard3 Secondary Primary EMEA
Shard4 Secondary Primary JAPAN
country region tag
USA CA SFO
USA FL NYC
USA CA SFO
FRANCE EMEA
CHINA JAPAN
25. My Writes My Reads
Boston 8ms 8ms
Chicago 23ms 23ms
Los Angeles 10ms 10ms
Paris 10ms 10ms
Tokyo 5ms 5ms
26. My Writes My Reads Other Reads
Boston 8ms 8ms 8ms
Chicago 23ms 23ms 23ms
Los Angeles 10ms 10ms 10ms
Paris 10ms 10ms 10ms
Tokyo 5ms 5ms 5ms
27.
28. My Writes My Reads Other Reads
Boston 8ms 8ms 8ms
Chicago 23ms 23ms 23ms
Los Angeles 10ms 10ms 10ms
Paris 10ms 10ms 10ms
Tokyo 5ms 5ms 5ms
Parallelism both i/o and cpuMongod processTwo new mechanisms
Yield on page faultWorks with a single collection kind of like record level locking. Very granularUse all I/O but not all cpuCommunity blog postTest is a single collection
Reader writer lock per databaseNo granularity to some granularity; more laterLocal database used by replication You can use multiple dbs if you need to
Try it and give us your feedback.Next: data center awareness and tag aware sharding.
What is it?NOT DRWhat do we want:Lowest latency possible for our usersPariton handlingNeed:Multiple data centers taking writes
I started a siteSimple photo sharingI upload pictures, send linksI can tag, secure, etc…I want my writes to be fast and my reads to be consistentOther people’s reads can be slightly inconsistent
my 2.0 setupAll writes have to hit NYMy reads go to NYOther reads can go eitherWhat do I want to do: - make “my stuff” fast - make “other stuff” fast
Administrators can use simple rules to make mongo put data in the most intelligent place
Shard1’s primary move dto SFO2 nodes in the primary, 1 on secondary
Now for users in LA, things are much betterTokyo is a little better, but not much
Shard1’s primary move dto SFO2 nodes in the primary, 1 on secondary
Now for users in LA, things are much betterTokyo is a little better, but not much
Mongos routes to closest
Mongos routes to closest
Well, unless you are traveling, nothing
Shard by timeCan move older data to slower machinesNew data can be on SSDs, etc..