Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To the author, if timestamp is only a timestamp, that will not guarantee uniqueness. It may be sufficient for your use case, but unless there are other constraints on your system design you may loose data (since they will be treated as duplicates and dropped).

If timestamps are just wall clock timestamps. You should be looking at the SQL type Timestamp (without timezones) as putting a primary key around text fields is not optimal. Not 100% on PostgreSQL, but I would look at moving timestamp to Timestamp and group to varchar.



The author has a conference talk talking about CRDT and the timestamp technique he uses. Really useful if anyone else wonders what's the problem with wall clock timestamps.

dotJS 2019 - James Long - CRDTs for Mortals (20:44): https://www.youtube.com/watch?v=DEcwa68f-jY

EDIT: btw, out of all the comments on the timestamp here, seems like only yours is not complaining about the format, and even points out that the article did not go in depth yet to specify the actual timestamp that he uses.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: