Recently this question came to my mind, and I reached out to pool of domain expert (my co-workers). They have provided my good insight that why mongodb is first choice for ceilometer in place of mariadb.
Whole credit for this article goes to my colleagues.
I found below link very useful to know about the differences in databases.
Main difference between mariadb and mongodb is while former is using the “Relational DBMS” Database model and latter is using “Document Store“.
1. sql-alchemy driver for ceilometer upstream has had much worse scaling & performance characteristics that the mongodb driver. It has improved in latest versions but still not up to the mark for production use.
2. MongoDB is not intrinsically faster than a relational database, it just happens to be a simplistic document store, so if your application is architected to optimize for that, then the MongoDB backend will perform faster. The popularity of MongoDB is largely because a lot of developers find this model to be very simple to develop for and it tends to be very forgiving for simple things.
The MySQL backend for Ceilometer is built in such a way that makes a lot of wasteful database calls that are unnecessary. Because MySQL can’t deliver all the different pieces of data for an operation in one IO operation the way mongo does, the application instead re-fetches the same data over and over again for every bit of data stored. This is unnecessary, as it should use a cache to optimize for this. MySQL is also a transactional backend unlike MongoDB, and when we additionally add a multi-node Galera backend to MySQL, the system is not as tolerant to concurrent write operations which impact the same rows; these should be serialized. With these two architectural changes the MySQL backend
could scale right up.
3. MongoDB is, in general, more efficient for time series data than a SQL database. This isn’t always true, and it depends on your architecture, but MongoDB seems to come out on top when it comes to data driven by Ceilometer.