Why we are using mongodb for ceilometer instead of mariadb ?

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.


One thought on “Why we are using mongodb for ceilometer instead of mariadb ?

  1. Pingback: 梅馨嫣栀 » Openstack云平台脚本部署之Mongo集群配置

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s