What you know about Round Robin Databases?

João Augusto Perin
3 min readMay 19, 2021

Hey, how long? 😃

Have you ever heard about Round Robin Databases? Or have you heard, but only thought about our little guy up there? Today I’m gonna explain how this thing works, its advantages and disadvantages. So let’s jump right into it:

What problem does it solve?

Think about common relational databases, like MySQL or Postres for instance. All the new data to be stored in those databases are appended to the end of a file, or “table” if you prefer the abstraction.

This way, the size of it keeps increasing ad infinitum. And that is the way we expect it to behave, hence the main role of a database is to keep our records always there, safe, and persisted.

But what if we want a large amount of data, but for now? Like for monitoring systems? or Graphics based on time series? Maybe the changes made last week, or month, or even semester? Yeah, you could argue that the relational databases would take care of the work, and you wouldn’t be wrong, but, bare with me that, this is not the most scallable thing to make.

And that’s when Round Robin Databases come into play.

How they work?

Take this image (the source is linked to it).

https://www.loriotpro.com/Products/On-line_Documentation_V5/LoriotProDoc_EN/V22-RRD_Collector_RRD_Manager/V22-A1_Introduction_RRD_EN.htm
source: https://www.loriotpro.com/Products/On-line_Documentation_V5/LoriotProDoc_EN/V22-RRD_Collector_RRD_Manager/V22-A1_Introduction_RRD_EN.htm

The “roud robin-like” databases focus on storing newest data at the beggining, overwritting the existing records if it needs to. It might be simpler to think of it like a circle, and now you’re going to understand the name “round robin”:

As the first record comes to a rrd (this is the abbreviation, and we’ll gonna use it from now on), it gets written into a point in memory. That’s good. Then, the system will still write other data that comes in along the perimeter of the circle, untill it reaches the data that was first written.

When it reaches, it will overwritte the existing data, leaving the new record inplace.

Conclusion

That’s it for this simple concept that end up scaring a lot people who never had the contact to those kinds of storages, and suddenly hear “RRD” for the first time.

There are several more details about RRD’s, like, for instance, some of the implementations can keep the changes between the last write, and the newest one that comes in eventually, like git does.

It obviously depends a lot on which implementations are you choosing, and how it gonna fulfill your needs.

And that’s it, thanks for reading! 😃

--

--

João Augusto Perin

I don’t know how to describe myself actually…maybe a hypothetical jedi? God no…that sounds like a bad album title from an underground 80’s band.