Hacker News new | ask | show | jobs
by crescentfresh 3171 days ago
> include primary key identifiers or timestamp values in your pagination strategy

And then we got that one customer that somehow backfilled old timestamped data and complained our pagination broke :(

1 comments

Many database platforms support column-level privileges or permissions which could be used to prevent that sort of backfill, by preventing UPDATE on the column that holds the creation timestamp.

I've also dealt with databases without column-level privileges. Where not handled by a column-level privilege system, it may still be possible to block this sort of UPDATE using a TRIGGER designed to fail.

Privilege grant (or drop of the trigger) could be used when the system is in an offline maintenance mode should you require the ability to correct that protected data, reinstituting the control when the maintenance is complete.

The criticality of the data and the level of automation in use would probably be the factors I would use to decide whether this overhead was warranted. Hopefully you had backups available.

Well in this case it was timeseries data, so technically supported (we "upsert", and timestamp is simply a part of the composite key).

It occurred when the clock on the hardware got messed up :(