There's this problem where im supposed to put a cooldown on write operation per user(lets call it N rows max).
-
I was thinking about what if do a query about no of rows from a particular user if it maxed out, then put a cooldown timer for some duration perhaps. This would mean before every write there's a query to DB about author xyz.
-
I can also keep track of overall writes to DB(dismiss the writes for a while if values reach a certain threshold) but this seems a bit inferior solution. This would also mean a query on but on the table (i think that's efficient in sqllite DB)
-
A separate table for each user where we keep count of all entries, then a query every x mins perhaps and if we reach a threshold. We start the cooldown but this adds more complexity in terms of handling cleanup afterwards.
Thoughts?