Technology · Database

MariaDB — database operation for shop, CMS and custom applications

MariaDB is the database under almost everything we build: Shopware 6, TYPO3, WordPress and custom applications on PHP 8 and Symfony. We design schemas, set indexes, hunt down slow queries and set up backups that actually get restored. Most of a shop's “performance problems” are not a server question. They are an index question.

standard database in house

What is MariaDB?

MariaDB is a relational database system: it stores an application's data in tables and answers queries against them — in a shop, that means products, prices and orders.

What we use MariaDB for

MariaDB runs under every system we look after. Shopware 6 keeps products, prices, customers and orders in it, TYPO3 its page trees and content, WordPress its posts. Then there are custom applications on PHP 8 and Symfony, where we design the schema ourselves — the business logic first, the tables after. Straightening out a data model later is paid for over years, in migrations.

A second large part of the work is grown data from legacy systems. Tables without foreign keys, a mix of latin1 and utf8 character sets, columns whose meaning nobody remembers. We move such data into a clean model, switch everything to utf8mb4 and write down the decisions we make along the way. It is unspectacular work. It does decide, though, whether a later migration is an appointment or a project.

How we work: measure first, then act

Before anyone talks about bigger hardware, we switch on the slow query log and look at which queries actually cost time. Then comes EXPLAIN: is the database reading half the table because an index is missing, or because the condition is written in a way that stops the index being used? Usually it is that. A composite index in the right place replaces more server capacity than a quote would suggest.

In Symfony applications, schema changes run through Doctrine migrations, versioned and rehearsed on a copy before they go live. Backups are part of managed hosting on our own servers in Germany — with a restore test. A backup that has never been restored is a guess. We also monitor connections, buffer sizes and disk space, because a full disk stops a database faster than any traffic peak.

When you do not need a database project

Not every slow page is a database case. When a shop with two orders a day feels sluggish, it is more often uncompressed images, an overloaded front end, or an interface waiting synchronously on an ERP. We measure that before writing a quote for database work. Sometimes the honest answer is that there is nothing to optimise here and the problem sits elsewhere.

Mid-sized projects just as rarely need a database cluster, a second database technology alongside, or a split across several servers. A well-designed MariaDB instance carries normal shop and portal load without contortions. Introducing replication, sharding and an additional store buys operational work that somebody has to carry permanently. That can be the right call. It should only be a decision, not a reflex.

Projects with MariaDB

A selection — not the full client list.

Frequently asked questions

Why is our shop slow even though the server is powerful enough?

In most cases an index is missing, not processing power. A query without a matching index forces the database to read large parts of a table, and that takes just as long however many cores the machine has. So we switch on the slow query log, look at the most expensive queries with EXPLAIN and change either the index or the query. Only if load is left over afterwards is it worth talking about hardware.

MariaDB or MySQL — does it matter for our project?

For most web and shop projects it makes practically no difference, because Shopware 6, TYPO3 and WordPress run on both. We use MariaDB as the default, because it is developed in the open and is straightforward to run in our hosting. The difference only becomes relevant with specific features or when a vendor prescribes one of them. In that case we look at the actual requirement instead of holding a debate on principle.

Do you also take over an existing database that somebody else built?

Yes, that is the normal case. Sharpness takes over grown data from legacy systems, reviews schema, indexes and character sets, and writes down what should be cleaned up and what can stay. Then comes a backup with a restore test, so the starting point is secured before anyone changes anything. Changes after that run versioned, through migrations. We do not replace anything that works just because it looks old.

MariaDB: existing system or new build?

We also take over systems that were built elsewhere — after a look at the code and the hosting.

What else we build with

Call Start a project