MongoDB is a very popular database, in fact, we love blogging about it. But what is MongoDB? And what are the best things to do with it, and what shouldn’t I do with it?
I get asked this a lot so here are the answers to these questions. Don’t worry if you’re not a developer, I’ll try not to get too technical and jargon-y.
What is MongoDB?
MongoDB is a NoSQL database – a NoSQL database is one where you don’t query the database with SQL. Other than that NoSQL really means nothing to define a database. So let’s have another go at defining MongoDB.
MongoDB is a JSON document datastore. It allows you to store and query JSON style documents with a few smarts on top. This means that you can store objects with nested data all in one collection (collections are like tables for MongoDB).
It is generally faster than traditional SQL databases for transactional stores but lacks the query power for Analytical usage.
When we needed a NoSQL database we chose MongoDB for a number of reasons:
- Works well in the cloud (scale, fault tolerance, secure)
- Easy to get started (lots of clear documentation)
- Used by many massive companies all over the globe, so MongoDB has money to keep development going.
What should I use MongoDB for?
MongoDB is great for transactional stores where performance is a concern. Its also great when the data structure is going to evolve over time, as its schema-less operations allow you to update the data on the fly.
What shouldn’t I use MongoDB for?
MongoDB isn’t so good for analytic loads, not because it can’t do aggregates or query large amounts of data, but because there aren’t many third party analytical tools that can query and report on data stored in MongoDB. MongoDB’s schema-less functionality means that you need to be careful when querying the data to make sure there are no data quality issues creeping into your reports.
Until next time…
Coffee to Code