Hello everyone,
We are porting our application from PostgreSQL to YugabyteDB, and I have a database schema design question:
Our original application running on PostgreSQL collects statistics data every 15 minutes and stores them in a database “stats” table, which is partitioned (via inheritance partitioning) such that (via some database triggers we have written) a partition is created for each day. Also, at the end of each month, we aggregate the data from the oldest partitions that span a month and store it into a separate “old_stats” database table, which is also partitioned (with a partition created for each month), and we drop the oldest partitions of “stats” table that were aggregated (one of the reasons being to avoid database bloating in PostgreSQL).
In YugabyteDB, since database bloating does not seem to apply, and since database table inheritance is not supported, we have so far ported this application by keeping the two aforementioned statistics tables, but without partitions. Upon aggregation of oldest data that spans a month, we just delete the corresponding database rows.
In a prototype of this porting we are running, we are seeing a large increase in the use of memory over time, even though we are collecting data for a very small number of objects (500, instead of around 50000 in our original PosgtreSQL application). Although we started out with a single tablet per cluster node per table, after a week of the prototype running we have reached 5 tablets per cluster node per table.
So, I am wondering if we are using the appropriate database schema when running with YugabyteDB, or if we need to make some changes or use a different approach to get this running efficiently under YugabyteDB.
Your input is greatly appreciated.
Thank you