Finally time for the almost final blog post on this series. It is the sixth lecture from the MongoDB course I am doing at 10gen education. As it is good tradition by now using film titles for the blog I will of course keep up this tradition. Nevertheless I can already say that the final blog post on this series will be a bit different from all the others as is the final lecture of the course.
But let’s start diving into the topics of this post. Those are:
- Durability of writes,
- Availability and Fault Tolerance and
- Horizontal Scaling.
Ok, so the first thing to talk about it …
What has been started more than five weeks back as my “small” personal MongoDB experiment is now entering its fifth round. Still I am following the corresponding MongoDB course at 10gen and this week it is all about aggregation functions. You know this is when in relational databases “group by”-clauses show up and things get a little bit more complicated than the usual Selects and Updates. As it is already some kind of tradition now for this series another film title has been chosen to be the godfather for this (fifth) posting. Having worked for several years in a project implementing a Network Data Warehouse on top of Oracle I had my share in (relational) aggregation functions. Thus I am really curious how this will be done in MongoDB. Let’s start.
“$sort does pretty much what you’d expect. It sorts the documents. But there are few things to keep in mind when you use $sort and the first is that $sort can be a real memory hug.” -Quotes from the course
Aggregation Functions – Warmup
In this paragraph we are taking a first look at the syntax and general concepts used for the aggregation functions in MongoDB. For this we will execute what would be a “count(*)” SQL-query in a relational database. As a sample collection we are re-using one of the already used collections from an earlier example:
Here we go again and I have to admit that my head is already spinning a little bit from all the MongoDB input during the last couple of weeks. With the fourth post in this series we have reached halftime in the 10gen’s seven week course on MongoDB. And another week another film title in the post heading. But it must be mentioned here that is was close with a suggestion made in the last posting of this series. Spoiler warning ahead: The film giving title for the next posting is already set in stone
“Indexes turn out to be the single most important factor for performance in MongoDB and any relational databases.” -Quotes from the course
But enough for the prelude, let’s jump into the middle of another week with MongoDB. And this week it is all about performance as is already indicated by the above quote.