mongodb at mercadolibre

29
What have we learned MongoDB At MercadoLibre

Upload: pablo-molnar

Post on 25-May-2015

1.507 views

Category:

Technology


2 download

DESCRIPTION

Presentation for MongoDB Buenos Aires 2012

TRANSCRIPT

Page 1: MongoDB at MercadoLibre

What have we learned

MongoDBAt MercadoLibre

Page 2: MongoDB at MercadoLibre

Overview

About MeLi

Why MongoDB?

Use cases

Lessons Learned

Wrapping Up

Page 3: MongoDB at MercadoLibre

MeLi - Platform

Page 4: MongoDB at MercadoLibre

MeLi - Facts!

20M requests / minute

50K requests / sec (peaks)4 Gb bandwidth / sec

Page 5: MongoDB at MercadoLibre

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

MeLi - Inside

Lot of fun here playing with new stuff :P

Page 7: MongoDB at MercadoLibre

MeLi - Inside

Lot of fun here playing with new stuff :POur NoSQL stack

RedisMemcachedHadoop

Page 8: MongoDB at MercadoLibre

MeLi - Inside

Lot of fun here playing with new stuff :POur NoSQL stack

RedisMemcachedHadoop.... and of course

Page 9: MongoDB at MercadoLibre

Why MongoDB?

Horizontal Scaling

High Availability

Performance

Flexible Data!

Page 10: MongoDB at MercadoLibre

Why MongoDB?

Horizontal Scaling

High Availability

Performance

Flexible Data!

Page 11: MongoDB at MercadoLibre

Why MongoDB?

JavaScript(‘ing)

Polyglot

Open Source

Awesome Community

Support

(... and more)

Page 12: MongoDB at MercadoLibre

Support :-)

Page 13: MongoDB at MercadoLibre

Use Cases

DB Documents

Social +700M

Orders +23M

Feedback +3M

Emails +61M

Items +200M

Logging +332M

Page 14: MongoDB at MercadoLibre

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

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

Use Case: Items

1 Item!

Page 17: MongoDB at MercadoLibre

Use Case: Items

1 Item!

Page 18: MongoDB at MercadoLibre

Use Case: Items

1 Item!

Page 19: MongoDB at MercadoLibre

Use Case: Items

1 Item!N x N x N ... > 100k rows

Page 20: MongoDB at MercadoLibre

Use Case: Items

1 Item!

Page 21: MongoDB at MercadoLibre

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

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

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

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

Lessons LearnedMonitoring

MMS - It’s free!

Page 26: MongoDB at MercadoLibre

Lessons LearnedPlan your actions!

Shard keyUpgradesCfg Servers...

+ bad decisions = Lot of rework

Page 27: MongoDB at MercadoLibre

Lessons LearnedPlan your actions!

StudyThink

Plan

Hands On!

Shard keyUpgradesCfg Servers...

+ bad decisions = Lot of rework

Page 28: MongoDB at MercadoLibre

Wrapping Up!

Meli loves MongoDB!

Page 29: MongoDB at MercadoLibre

The End

Questions?

{  name     : "Pablo Molnar",   title    : "Software Engineer", work    : "MercadoLibre", location : "Buenos Aires", twitter  : "@pablomolnar"}