Extended data storage for selected entities

I have successfully migrated to MariaDB and the default 10 days of retention is mostly fine for me. BUT I’m looking for a solution on how to increase the number of retention days for some entities (like a smart scale to keep your health data for a year or so). So basically I’d like to keep 10 days for most, maybe 30 days for some and 365 days for a few). Can someone give me a hint on how to go about this?
(Maybe you can connect several databases and redirect specific entities)
Thank you in advance