I am writing an application in Erlang/OTP and want to use sequential counters on a version recording system.
I first implemented them with
mnesia:dirty_update_count
Well, since Mnesia data is not guaranteed to replicate atomicly you have to manually lock somehow. I see three alternatives (two with locking and one without):
Using read locks on the table as you request a new version number. That implies transactions though.
Use a central server that keeps track of the version numbers and increment them atomically, for example by having a process on one of your nodes which you ask for version numbers.
Synchronize your servers with NTP and use timestamps.