mongodb at mercadolibre
DESCRIPTION
Presentation for MongoDB Buenos Aires 2012TRANSCRIPT
What have we learned
MongoDBAt MercadoLibre
Overview
About MeLi
Why MongoDB?
Use cases
Lessons Learned
Wrapping Up
MeLi - Platform
MeLi - Facts!
20M requests / minute
50K requests / sec (peaks)4 Gb bandwidth / sec
MeLi - Facts!
20M requests / minute
50K requests / sec (peaks)4 Gb bandwidth / sec
Our farm
+1000 physical server+6000 virtual instances
MeLi - Inside
Lot of fun here playing with new stuff :P
MeLi - Inside
Lot of fun here playing with new stuff :POur NoSQL stack
RedisMemcachedHadoop
MeLi - Inside
Lot of fun here playing with new stuff :POur NoSQL stack
RedisMemcachedHadoop.... and of course
Why MongoDB?
Horizontal Scaling
High Availability
Performance
Flexible Data!
Why MongoDB?
Horizontal Scaling
High Availability
Performance
Flexible Data!
Why MongoDB?
JavaScript(‘ing)
Polyglot
Open Source
Awesome Community
Support
(... and more)
Support :-)
Use Cases
DB Documents
Social +700M
Orders +23M
Feedback +3M
Emails +61M
Items +200M
Logging +332M
Use Case: Social
Store Meli’s users social dataLOT of data (friends, likes, ...)> 500 Gb> 700 M documents12 shards servers : 4 replica setEach replica set = 3 servers80Gb per instance
Use Case: Social
Store Meli’s users social dataLOT of data (friends, likes, ...)> 500 Gb> 700 M documents12 shards servers : 4 replica setEach replica set = 3 servers80Gb per instance
Special thks to
@TioBorracho
Use Case: Items
1 Item!
Use Case: Items
1 Item!
Use Case: Items
1 Item!
Use Case: Items
1 Item!N x N x N ... > 100k rows
Use Case: Items
1 Item!
Use Case: Logging
Info logsRabbitMQ messagesTrack certain use cases
Errors logsSomething bad happen...Recuperable errors with retry handler
Capped Collections!
Lessons Learned
File SystemNSF: Bad choice, Poor results
Ext4: Far much better
Mount OptionsReducing Disk IO by mounting partitions with noatime and nodiratime
Track disk performanceiostat -xm 2 (%util column < 100%)
Storage
Lessons Learned
Shard instances4 cores
>= 16 Gb ram
Config serverlow cpu consumption
1Gb ram / 1Gb storage
Mongosruns along with the webserver (client)
1 mongos x webserver
VM’s
Lessons Learned
Disk usage (with zenoss)
Ping health check
Monitoring
curl --connect-timeout 3 \ --write-out %{http_code} \ --silent \ --output /dev/null \ http://localhost:28017/_status
Lessons LearnedMonitoring
MMS - It’s free!
Lessons LearnedPlan your actions!
Shard keyUpgradesCfg Servers...
+ bad decisions = Lot of rework
Lessons LearnedPlan your actions!
StudyThink
Plan
Hands On!
Shard keyUpgradesCfg Servers...
+ bad decisions = Lot of rework
Wrapping Up!
Meli loves MongoDB!
The End
Questions?
{ name : "Pablo Molnar", title : "Software Engineer", work : "MercadoLibre", location : "Buenos Aires", twitter : "@pablomolnar"}