Pick a MySQL, any MySQL

Larry Garfield
Director of Developer Experience
23 Jul 2019

Platform.sh has always offered a database service called “mysql.” Afterall, it’s the dominant Open Source database. However, as with most providers, it wasn’t actually MySQL (the product published by Oracle), but MariaDB—a MySQL close-fork fully compatible with MySQL, extra bug fixes included.

Times change, of course. With the latest releases of MySQL and MariaDB, they have begun to diverge such that some functionality is available only in one or the other. Some database analysts have concluded that they really ought to be viewed as separate database products. What’s a cutting-edge Platform-as-a-Service to do? Which one should we offer?

Introducing Oracle MySQL on Platform.sh

We’re happy to report that you can now deploy (for-reals) Oracle MySQL, both versions 5.7 and the new-and-shiny 8.0, on Platform.sh Professional.

including a MySQL service is as easy as adding any other service. Just insert the following into your services.yaml file:

    type: oracle-mysql:8.0
    disk: 1024

And you’re done. That’s all the configuration you need, but all of the more detailed configuration options for mariadb (such as adding multiple databases on a single service) work exactly the same. See the MySQL/MariaDB documentation for more details.

Application code and language-specific libraries may or may not vary between Oracle MySQL and MariaDB. Consult the documentation for your connection libraries to be sure.

But I want MariaDB’s special features!

They’re really nifty, aren’t they? But don’t worry, MariaDB isn’t going anywhere. The mysql service type will continue to exist and refer to MariaDB just as it always has. You can also now refer to it as mariadb. So the following are both entirely valid and have the same effect:

    type: mysql:10.2
    disk: 1024
    type: mariadb:10.2
    disk: 1024

You can safely switch from mysql to mariadb if you want to make your services.yaml file a bit more accurate. Please note, however, that a direct switch from mysql to oracle-mysql (or vice versa) is not supported and may not work properly. If you want to switch which database service you use, take an SQL dump file, change the service definition and give it a new name (to get an empty database), and import the SQL file into it.

Whatever your SQL flavor preferences, you still get the flexibility, branching deployment, and peace-of-mind that Platform.sh brings.