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_counterbut the experience of using it drove out these hard requirements:
The counters must have the following properties:
be strictly sequential - 1 followed by 2 followed by 3 etc, etc the sequence is shared across a distributed set of systems and if I have you down as a '3' and you come in a '5' I need to know we have lost some comms and should resync
safe with a distributed database
mnesia:dirty_update_countermeets neither of these requirements.
How could I implement a sequential database counter?