Index lifecycle for multi-tenant app with different tiers

Hi team!

Got a question that I ve been thinking about for the past couple of days but can't come up with an elegant solution.

We have a multi-tenant app. Many users are accessing a cloud software. Different users have different pricing tiers: free, pro, enterprise. Different tiers have different data retention, e.g. free = 14 days, pro = 30 days, enterprise = 60 days. Numbers and examples are all made up.

I would like to be able to introduce this logic as part of our index lifecycle . I was thinking that I introduce the tier as part of the index name. (e.g. rawdata-free, rawdata-pro etc.) I assume this will work fine but someone may jump tiers by purchasing, upgrading, downgrading etc.

The next - not so elegant solution - is to do this manually. Use the delete by query api and delete documents conditionally within the index. Not great as there will be TBs of data in a month (and not on the same index)

Anything else I should be using?

It should work, yes.
You would need to work out the complexities of changes in levels yourself though.