MongoDB – Part 2 – Databases

OK. So in part 1 we covered a bunch of MongoDB basics. In this part, I plan on covering in detail the core MongoDB databases, what collections they have and what they’re used for.

When you first install MongoDB, two databases are created for you called admin and local. They don’t contain many collections and may not even contain any to begin with, however don’t worry about this, Mongo will create them as an when it needs them.

The third core database is called config. Config databases are a little more complicated, in that they can only be accessed when connected to a shard instead of a particular daemon. I haven’t covered shards yet. But for now just think of shards as individual mongod nodes, that all together form your data set. How this happens is very customisable, these customisable setting are stored in the config database. I’ll cover shards in great detail in a separate post.

Edit: Learn about MongoDB shards

Continue reading →

MongoDB – Part 1 – Collections, CRUD, Modifiers, Commands

Recently I’ve been posting a lot of articles about database and more specifically NoSQL. I’ve given a quick overview of each of the NoSQL database types as well as an overview of common concepts that appear throughout most NoSQL databases. Now I want to focus on a specific NoSQL database and I have Chosen MongoDB.

MongoDB is the most popular NoSQL database out there right now and you don’t have to take my word for it. Looking at Google Trends, you can see that MongoDB is getting more searches than Redis, Neo4j and Cassandra combined. Each of these databases are leading the way for their own database model (key-value, document, column and graph). So if you plan on learning a new database, MongoDB is without a doubt a fantastic choice. I’ve personally really enjoyed working with it the last 3 months and can see it being a popular choice for a very long time.

Continue reading →

NoSQL Essentials – Part 6 – Migrations, Polyglot persistence and more

This is the final article on my NoSQL concepts series, before I start to focus on a specific database probably MongoDB. I’ve covered all of the popular NoSQL database types (key-value, document, column-family and graph) as well as given an in-depth overview of NoSQL as a whole. Just to round everything up, I’m writing this article to give some final tips and tricks.

Throughout this series I have been writing about, what I have learnt from reading the NoSQL Distilled book by Martin Fowler and Pramod J. Sadalage. Here I am going to be writing about the final few chapters: Handling schema migration, using polyglot persistence, additional storage engines and how to choose the right database.

Continue reading →

NoSQL Essentials – Part 5 – Graph databases

Neo4J

So far I’ve covered key-value, document and column-family databases. All that’s left now are graph databases. However surprisingly, they’re nothing like what I’ve covered so far. They’re used in completely different scenarios to other NoSQL stores and are also structured like no other database out there.

When thinking about graph databases you can almost forget about everything you know about NoSQL. You can forget about tables, columns, rows, aggregates. Instead you need to know about entities aka nodes, edges aka relationships and properties. Common graph databases include Neo4J, Infinite Graph, OrientDB, FlockDB. In this article I am going to be focusing on the most popular of the bunch, Neo4J.

Graph database are commonly used in the social scene. Their main goal is to map huge amounts of data and to find patterns in data. For example this could be to find people you may know based on who your friends know or to finds bands you might like, based on who your friends like.

Continue reading →