Summary of my talk about MongoDB sharding











MongoDB User Group Madrid (

Date: October, 13th 2015 19:00h.

Place: Telefónica Flagship Store building. Gran Vía street, 28 28013 Madrid

Room: Auditorium. First floor

Event: MongoDB User Group Madrid (

Talk 1: Tag-based sharding

Speaker:  Juan Roy @juanroycouto

Talk 2: GridFS

Speaker:  Rafael Aranaz (Paradigma Tecnológico) @rafaranaz

Tag-based sharding talk (Juan Roy)

I begun asking this question to my audience: ¿do you think that MongoDB can help us to distribute the students of a school across its classrooms?

Firstly, I explained briefly what a cluster is, its objective, what components takes part on it and the functions of all of them. My purpose was that everybody understood this (even those with less expertise), basic to understand the next parts of my talk.

With the same purpose I talked about some necessary concepts for understanding how sharding works, like: chunk, split, migration, balancer,…

Once these concepts were well known came the turn of knowing two aspects of the internal MongoDB working:

  1. How a chunk is split.
  2. How a chunk is migrated.

At this time I had ended my theorical explanation. Using the question I did at the very beggining I told, and showed in a practical manner), that MongoDB offers us three ways to balance the school’s pupils, these:

  1. Without manual intervention. MongoDb choose the points to do the chunk splits and distribute them evenly across the shards.  This way we get the same number of pupils (chunks) per classromm (shard), but pupils have not been well grouped based in their age, moreover, pupils are in classrooms that don’t  belong to.
  2. The next option is to do a pre-splitting. Using this technique we can group pupils based in their age (we choose the ranges per chunk).  However, pupils are not in their classrooms again because MongoDB has choosen the shards they have been moved to.
  3. The last option is tag-based sharding. Now we are able to group puplis age-based and distribute them to the classrooms they belong to. In order to aim this goal, we must tag our shards (classrooms) and when we create our chunks we assign the shard it will be moved to.

Before ending I could answer the questions the public did, in a proper way I think, and I said that in we are looking for contributors.

What are my conclusions?

  • Building, auditórium and media were fantastic.
  • Great people.
  • Few people attending, perhaps the rain or the day after a long weekend.
  • The talk duration with questions was about an hour. More tan its normal for these meetings.  If I think what part could I leave aside it could be the cluster explanation with its components. Anyway, I think it was necessary in order to get the understanding of everybody.
  • The practical show run without problems and was a perfect complement for theorical explanation. comments

Javier Nieto

A very instructive talk.

Sergio Romero Carrizosa

Due to this good talk I learned a lot of stuff and now I am looking for learn more, thank you all for sharing your time.


Pablo Sancho

Thank you very much. Very interesting.

Leave a comment

Your email address will not be published. Required fields are marked *

1 × 5 =