Skip to content

mongoDB

Alexander Czigler edited this page Jun 17, 2022 · 2 revisions

mongoDB

Developer Experience

I find mongoDB to be one of the easiest databases to work with. There is great documentation and mongo is old enough for there to be plenty of articles on places like stackoverflow in case you bump into specific issues.

mongoDB is very simple to get started with, once you run the docker image you can connect to it and start using it. You can put off most of the configuration until later.

All this simplicity does have a cost however because you are never forced to stop and make any decisions. If the size, complexity or usage of your application grows too fast you may realize too late that you need some in-depth knowlegde about mongoDB to maintain performance.

Query API or DSL

MongoDB uses its own API and I find it very simple and straightforward. Getting started with mongoDB is super simple, as soon as you connect to the server you can start saving and working with documents and collections.

Support for hierarchies (documents in documents, etc)

mongoDB supports hierarchies by linking documents. This is against their own recommendation however because it may affect performance in the long run.

In general, we recommend modeling data in a way that data that is accessed together is stored together. When data is modeled this way, you will have better performance and transactions will not be required.

Platform and language support (besides JS/TS)

There are a bunch of officially supported drivers; from C and C++ to ruby, rust and dotnet and node.

Deployment options

Easy to run their docker image locally. Managed cloud deployment options.

Serialisation support (JSON, others?)

mongoDB stores data in BSON (Binary JSON). Working with javascript objects is straightforward, it just works. mongoDB also supports mapping C# classes, which requires a few lines of code but is also rather straightforward and similar to working with a typical ORM in .NET.

Developer experience

As mongoDB is so easy to get started with I belive it has the best DX for new and smaller projects. There is a low threshold to get started and learning the basics.

A project using mongoDB can put off writing migration scripts as long as the data models are only extended and not modified. This keeps the complexity low.

Summary

Pros

  • Easy to use
  • Developer friendly
  • Simple
  • Scalable
  • Managed options in AWS, Azure, GC...

Cons

  • Normalizing data will yield higher storage costs compared to other db's