Why MongoDB?
- for small data because its simple and programmer friendly
- for big data because it can scale horizontially with sharding
*Document model, and JSON make those possible
Document model
Document model is general, we can embed/use arrays and nest, or we can choose not to. MongoDB is newer technology and focused on horizontial scaling and to be programmer friendly. But this was a decision not a document model restriction, for example joins and ACID transactions are already added when they are needed.
Simple
High level database, objects are represented as they are in the real world
Modelling and querying is intuative
Programmer friendly
- supports all the 3 types of programmers (see bellow)
- data in database and data on the application are stored in the same way (hash-maps/arrays and optionally nested)
- drivers and JSON allows us to embed queries directly in our code
- JSON allows the easy construction of query builders in all languanges
Programmers
Programmers can be splitted in 3 categories
- aplications programmers
- data engineers
- database programmers
Data applications need all those 3 categories on programmers, so a database that satisfy the needs of all of those 3 is very important to have.
Application programmers
Application programmers like MongoDB because
- they can query inside their code using their driver
- JSON is widely supported
- or they can use a query builder (query builders are easy to make because MQL is JSON based)
- data in the database are like the data in their code, hash-maps/arrays/nested
Data engineers
Data engineers like MongoDB because
- aggregation framework is so powerful, allowin data processing inside the database
- they have many data structures to use like hash-maps/arrays/nested
- support for in memory database for faster processing of data
Database programmers
Database programmers like MongoDB because
- its flexible schema
- allows us to choose if we want to pre-connect data or not
- gives us support for joins and acid transactions when data should be seperated
Programmers and cMQL
cMQL can make MQL queries, compact and more programmer friendly
- programmers can avoid JSON syntax
- keep the functional style of MQL that is good for data processing
- medium complexity queries become easy
- complex queries are compact and easy to write even for multi-level nesting
allowing data engineers to process their data using a functional programming language
Summary
MongoDB is a general database
- supports all those 3 types of programmers
- data model is flexible allowing us to choose how to structure our data
Document databases in general are the only databases that can reduce the gap,
of those 3 types of programmers.
cMQL makes MongoDB even more programmer friendly.