MongoDB at MercadoLibre
-
Upload
pablo-molnar -
Category
Technology
-
view
1.507 -
download
2
description
Transcript of MongoDB at MercadoLibre
![Page 1: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/1.jpg)
What have we learned
MongoDBAt MercadoLibre
![Page 2: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/2.jpg)
Overview
About MeLi
Why MongoDB?
Use cases
Lessons Learned
Wrapping Up
![Page 3: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/3.jpg)
MeLi - Platform
![Page 4: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/4.jpg)
MeLi - Facts!
20M requests / minute
50K requests / sec (peaks)4 Gb bandwidth / sec
![Page 5: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/5.jpg)
MeLi - Facts!
20M requests / minute
50K requests / sec (peaks)4 Gb bandwidth / sec
Our farm
+1000 physical server+6000 virtual instances
![Page 6: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/6.jpg)
MeLi - Inside
Lot of fun here playing with new stuff :P
![Page 7: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/7.jpg)
MeLi - Inside
Lot of fun here playing with new stuff :POur NoSQL stack
RedisMemcachedHadoop
![Page 8: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/8.jpg)
MeLi - Inside
Lot of fun here playing with new stuff :POur NoSQL stack
RedisMemcachedHadoop.... and of course
![Page 9: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/9.jpg)
Why MongoDB?
Horizontal Scaling
High Availability
Performance
Flexible Data!
![Page 10: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/10.jpg)
Why MongoDB?
Horizontal Scaling
High Availability
Performance
Flexible Data!
![Page 11: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/11.jpg)
Why MongoDB?
JavaScript(‘ing)
Polyglot
Open Source
Awesome Community
Support
(... and more)
![Page 12: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/12.jpg)
Support :-)
![Page 13: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/13.jpg)
Use Cases
DB Documents
Social +700M
Orders +23M
Feedback +3M
Emails +61M
Items +200M
Logging +332M
![Page 14: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/14.jpg)
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
![Page 15: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/15.jpg)
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
![Page 16: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/16.jpg)
Use Case: Items
1 Item!
![Page 17: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/17.jpg)
Use Case: Items
1 Item!
![Page 18: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/18.jpg)
Use Case: Items
1 Item!
![Page 19: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/19.jpg)
Use Case: Items
1 Item!N x N x N ... > 100k rows
![Page 20: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/20.jpg)
Use Case: Items
1 Item!
![Page 21: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/21.jpg)
Use Case: Logging
Info logsRabbitMQ messagesTrack certain use cases
Errors logsSomething bad happen...Recuperable errors with retry handler
Capped Collections!
![Page 22: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/22.jpg)
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
![Page 23: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/23.jpg)
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
![Page 24: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/24.jpg)
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
![Page 25: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/25.jpg)
Lessons LearnedMonitoring
MMS - It’s free!
![Page 26: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/26.jpg)
Lessons LearnedPlan your actions!
Shard keyUpgradesCfg Servers...
+ bad decisions = Lot of rework
![Page 27: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/27.jpg)
Lessons LearnedPlan your actions!
StudyThink
Plan
Hands On!
Shard keyUpgradesCfg Servers...
+ bad decisions = Lot of rework
![Page 28: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/28.jpg)
Wrapping Up!
Meli loves MongoDB!
![Page 29: MongoDB at MercadoLibre](https://reader036.fdocuments.in/reader036/viewer/2022062303/5562523bd8b42aa52d8b50ca/html5/thumbnails/29.jpg)
The End
Questions?
{ name : "Pablo Molnar", title : "Software Engineer", work : "MercadoLibre", location : "Buenos Aires", twitter : "@pablomolnar"}