But I have a database that’s already 300K+ records and it’s growing at 100K+ per month.
Is it a good idea to purge older records or move them to another table? I reckon such a backend operation would probably take a long time (and might possibly be very risky if it fails halfway).
As a general rule of thumb, you don’t want to delete historic data but there are some situations where deleting the data makes sense such as;
Holding onto the data creates a growing security risk, for example if you’re holding PII data on customers who haven’t interacted with your brand in years.
The data basically expires after a short amount of time and there is no value in keeping it
The other thing to check is whether there’s any regulatory requirement to keep the data for a set period of time in case there’s a regulatory audit.
If you want a technique for purging older records, I’d just setup a database trigger event with whatever criteria you deem appropriate and it will just tick them off one at a time, for example deletes a record after 12 months.