Hacker News new | ask | show | jobs
by lobster_johnson 3693 days ago
Hi, thanks for responding.

What I need is for our translog to reflect the order of updates. So if diff A was applied before B, then the translog order also needs to be A, B. (The order only needs to be consistent per document.)

This is because we have listeners — through APIs — that play the translog as it happens and maintain various state based on it.

Currently, the translog is ordered by a sequential number (because it's cheap in Postgres), but every entry also records the ID of the previous entry (so B will point at A). One could sort by time and then reorder by causality before emitting the linear log to consumers, but that would of course be more complicated than one that is already linear.