Work has started on crafting the dominance database. If you followed the updates so far then you already know the database was responsible for virtually everything that happened on tick, and was the sole bottleneck in incarnations past. Nowadays databases perform their functions much more efficiently, and the hardware is much faster so while the database itself is no longer a pressing concern, some questions do show up.

First question (and the only one I’ll cover today) was which database to use. Only real contenders were MySQL (MariaDB to be precise) or PostgreSQL, but as both have their benefits and flaws choice is far from simple. MySQL has simplicity on its side, and it already served well in the past. PostgreSQL had the air of authority and PL/Python on its side, but it may be an overkill. There is no clear winner here.

All the pros and cons aside, the choice turned out to be a personal one.

Originally I wanted to roll with Postgres, but then decided to take a peek inside the old base (namely beta 6 archives). Inside I found a lot of interesting things – the table design was solid, but huge amounts of views, functions and procedures would have to be rewritten. If the table specification + all data for a new beta was 100 kB, procedures alone are four times as much, in code alone (and no data). That’s a lot of code to replicate, and is the effort worth the time? The rewrite was already completed once, in V2, so why dump all that?

Jury is still out on the final choice, but unless someone gives me solid arguments, I believe I’ll roll with PostgreSQL – reasoning being that it’ll give me a fresh perspective and the code won’t be a simple port (not that it’s trivial to port all those procedures) but a guided recreation of the original functionalities, with new features in mind.