Hacker News new | ask | show | jobs
by Thomaschaaf 908 days ago
Handling stale data needs to be considered when implementing it. ORMs like Prisma execute an update query and follow it up with a select. This would result in stale data being returned most of the time. If you use this data expecting your update to be contained in it you are going to have a bad time (statemachines, etc.)
2 comments

Not if replication lag is also being monitored.

If you need sub-second live data, then yeah, you need to read from the primary. Most applications do not, and 1-2 seconds of potential lag are acceptable.

Why would it result in stale data being returned most of the time?