0
Your database is lying to you about time
https://stack.convex.dev/your-database-is-lying-about-time(stack.convex.dev)Databases can present a misleading view of time through different timestamps, particularly in distributed systems. The time returned by `Date.now()` within a transaction is often fixed for determinism, and a document's `_creationTime` is assigned before the transaction actually commits. Because transactions run in parallel and can finish out of order, relying on these timestamps can cause issues like missing rows when processing data sequentially. The solution is to use the database's internal "commit time," a monotonically increasing timestamp assigned when transactions are serially committed, which guarantees a true chronological ordering for events.
0 points•by hdt•1 hour ago
Comments (0)
No comments yet. Be the first to comment!
Have an account? Log in to join the discussion.