Direct naar content

The grand prix of databases

Formula 1, never before has it been so popular. The fact that Max Verstappen is not doing undeserving business in the king class certainly contributes to that. Who doesn’t remember last year’s spectacular finale? His comfortable lead in the championship is, besides his talent, also due to the qualities of the car. Such a Formula 1 car is one big jumble of technology and the trick is to find the right configuration and setup to achieve maximum performance. In this blog, we make a comparison with the setup of databases.

Edco Wallet

Co-Founder & eigenaar
Edco Wallet - Co-Founder & eigenaar

Countless possibilities

A formula one car can be tuned in many ways. If we limit ourselves to the basic setup, it involves pure engine power, front and rear downforce, top downforce, bottom downforce – ground effect – brake balance and tire management.

Simply put, assuming similar engine power you will go faster on the straights with low downforce (the car is pushed less on the road) and with high downforce you can fly through the corners but lose speed on the straights.

More downforce at the front of the car gives oversteer (when turning into a corner the rear of the car wants to overtake you) and higher downforce at the rear gives understeer (the front of the car wants to go straight when you turn in). Not to mention the driver’s wheel, which in most cases has a minimum of 18 buttons to adjust things or choose setups while driving.

Opposite effect

In a nutshell, you would say: one hundred percent engine power, maximum downforce and bang with the box. But the high engine power means more fuel consumption, which is detrimental to weight, and the high downforce causes a lot of tire wear, which means more pit stops. For every choice there is a solution, but it often brings a new problem.

Default settings

Most Formula One teams start on Friday during the first free practice with a kind of standard setup. Everything a bit standard. Depending on the track, that is adjusted: a little more or less downforce in relation to the ratio of long straights and corners.

As the free practice sessions progress, more and more fine-tuning is done until the right and best setup is found. Feedback from the driver is crucial in this game, how does the car behave in practice and how would the driver like the car to behave, a little more understeer or oversteer. Things like that.

The comparison with databases

A formula one car with only default settings will not win races. So is it with databases. Opensource and cloud databases are very easy to download and install or start. With a few clicks – next, next, finish – you have a database cluster up and running in minutes, in standard setup. But will the database still respond as intended when you actually load it? Which knobs are you going to turn? Or will you have to deal with opposite effects?

Tuning and balance

Databases (even cloud databases) also have countless configuration options. Each situation is different. You use a different setup if you need a lot of storage (high volumes) and again if you have a lot of read and write operations (I/O).

Which version do you use, how much CPU do you deploy, what do you do with memory, clustering, automatic failover, cache and indexing? Or do you even have to go back to the drawing board because the number of databases is growing significantly and your chosen model no longer works with the growth it is experiencing? Is it better to go with Kubernetes and pods instead of a huge database cluster?

Back to basics

Many database performance problems are not solved permanently by just deploying heavier hardware. Neither does the way DBaaS fully-managed cloud databases scale with CPU or working memory. Eventually, you will have to take a closer look at your setup if your database no longer behaves the way you want it to.

What is your data model, how are you handling data types, your method of indexing, the state of indexes, temp files, storage, specific database settings, and how is your query plan?

Porpoising – example of opposite effect

To promote “short tracking” and overtaking, the FIA has reintroduced the so-called “ground-effect” starting this season. Ground-effect is downforce created from underneath the car.

Through an ingenious system of tunnels in the floor, the car is sucked to the ground at high speeds, creating more grip. In addition, there is less “dirty air” behind the car, allowing another Formula One car to drive much closer behind another. A number of teams have suffered from porpoising this season.

Because the car is tuned ‘too low’ and too flexibly, the car is pulled toward the asphalt, hits the asphalt and bounces up, until the ground effect kicks in again and the car thumps on the asphalt again. This bouncing is called porpoising. By tuning the car higher, you no longer suffer from this, however, you therefore also lose a lot of speed on the straights. Some Formula 1 teams really had to go back to basics.

To measure is to know

Before you start turning knobs, put good monitoring in place. Use PMM from Percona, for example. That way you can map out in detail where the pain points really are.

And, big advantage, most database experts that you then bring in to help you further, will be very happy that you have PMM running on your environment for a few weeks. That gives a lot of guidance and the real work can begin almost immediately.

Still want to have a database expert look at it?

Are you having unexplained performance problems or do you want to make sure your environment is ready, stable and secure for the future? So that you too can win races? Feel free to contact us, we would like to help you.