MySQL
🐬
Tables, rows and truths.
Scalable database resources, optional, on demand. MySQL is part why PHP is so popular. It's the M in the LAMP stack.
Most classical CMS systems, such as WordPress and Craft CMS are using it as the central data storage. Alternatives to MySQL are PostgreSQL and Redis derivatives like Valkey.
Booking MySQL
A MySQL database is an optional component available in different plans. Each environment can have one database component containing one database booked. The database can have multiple tables of course. Currently, only MySQL databases are available.
Configuration
When the database is enabled, multiple settings and metrics become available in the dashboard. Please refer to the MySQL usage section to learn more.
Scaling
Database plans differ mostly in the available storage, as well as the associated computing power. Usually MySQL and PHP are scaled alongside since they rely on each other. As a rule of thumb, match PHP XS with MySQL XS, PHP SM with MySQL SM etc. See database performance.
When autoscaling is enabled, smaller and larger plans are automatically booked, based on MySQL storage usage. If autoscaling is turned off and the limit is reached, the environment may go offline. Either upgrade the plan or clean up the database.
Why MySQL storage grows
MySQL storage may grow over time as your application writes more rows to the database. Keep an eye on the metrics provided in the dashboard. Most usage might be desired, misconfiguration or misusage can also be the source of growing demand. This can happen actively, or passively. Databases can grow unexpectedly in undesired ways. A crawler bot can create endless entities, or a plugin generates excessive logs.
- Extensive logging
- Keeping "versions" of entries
Cleaning up the database
Rather than simply upgrading the database plan, review whether the database usage is justified and clean up if necessary:
- Connect to the database
- Query large tables, see here
- Review if data is required
DELETEorDROPtables, columns, and rows that are not needed- Wait a few minutes for the fortrabbit system to detect the new usage
Once you've resolved the issue and identified its cause, update code and config to prevent it from happening again. Keep an eye on the hosting metrics how usage behaves over time.
MySQL OFF
The database is optional on fortrabbit. Your application may not require a database at all. Kirby, Statamic and Grav as static file systems are not requiring MySQL in the basic setup at all. Or maybe you run a Laravel application that only consumes a third party API or uses Redis. Please refer to the software requirements of your CMS or framework.
Shared plans
These are the most commonly used plans. Indeed the XS and the S plan are covering most normal website scenarios already. You can store a lot of text in 256 MB.
Dedicated plans
Higher plans are available for heavy users and large databases.