MySQL role in Monolith is just to keep the data in case we want to rebuild various Elastic Searches indexes.
The database stores directly JSON objects, as blobs. It has the following fields:
We have two types of interactions with the database:
All metrics that are collected from various sources are stored into MySQL, in a single table that has a type, a date and a source_id field. The data itself is stored as-is in a binary field.
We’re planning to store roughly 1M lines per month, so 12M lines per year, and eventually shard the storage into one table per year - so we limit the size of the table to 12M lines.
The sharding will not impact metrics queries that are made through Elastic Search - but the reindexation script will have to take into account this sharding.
SET GLOBAL innodb_file_format='Barracuda'
SET GLOBAL innodb_file_per_table=1