Global persistent monotonic counters

Are there any persistent global monotonic counters, I’m looking for one that persists through compilation/release.

my current strategy is to use a dets table saved to a specific location, but that introduces subtle race conditions, I should probably wrap it in a GenServer, but before I do that I would love to hear you out.

If you don’t want to setup a GenServer, global will due.