Choosing the right disk size
What are binlogs?
When transactions are executed against a MySQL database they are also stored as binary logs (binlogs). These logs are then used to write the same transactions to redundant database nodes in the cluster, or may be used to set the database back to a previous state. In this way they provide a mechanism to keep or recover past transactions when needed. Binlogs are typically kept only for a limited retention period, after which they are deleted. Below we explain what you should consider when choosing a volume size for your database.
Why binlogs are important
Impact on disk usage
Binlogs are written to the same storage volume as the data itself and deleted after the retention period of one day has passed. While they are stored, they contribute to the storage use of the database on the volume. The larger the amount of transactions executed against a database, the larger the binlogs will be. Generally, the exact size of the binlogs is hard to predict as it depends on the database size, the amount of transactions, the use of indices, and specific MySQL functionality.
Large transactions
In case of large imports or when a high amount of transactions is executed against the database, the binlogs may increase to a significant size on the volume, even beyond the size of the data itself. Although this will recover over time as the binlogs are deleted after the retention period, the database may temporarily become much larger than expected. This may even result in the storage volume reaching its maximum capacity.
What to consider
In case you wish to migrate a database to a MySQL Database on Nexaa by ingesting your data all at once, the size of the binlogs may cause your volume to reach its maximum capacity. This means that the storage volume should be large enough for both the data and the binlogs. Once the retention period is passed, the binlogs are deleted and this storage space will be available again.
This means that your storage volume has a larger size than your database may need. If this is not desired, please consider ingesting your data in smaller batches over a longer period to prevent the binlogs from becoming too large in size.
Monitoring binlog size
The current size of the binlogs can be seen and monitored in the monitoring dashboard of the MySQL database in the storage graph. Here, you can monitor the size of the binlogs and also compare it to the size of data itself. As the total storage of data and binlogs approaches the maximum volume size, the database cluster may stop being responsive and the logs may not update anymore. If this happens, please increase your cluster resources or contact support.
Note that the total usage includes the binlog size.