I am building a gaming system where many players can play some sort of table game together. There could be hundreds of game tables at the same time. The system consists of several components where the main components are gaming servers and DBworker and in between there is rabbitMQ. DBWorker is the component that takes care of the databases.
So, I need to make sure that each game has unique ID to properly track results of the games. I would love to have some sort of auto-increment solution. Of course I can do some sort of sequence in PostgreSQL DB and pull new ID every time but for me it seems as an obvious bottleneck (I don’t want to be linked to DB all the time. In case DB goes down show must go on while our engineers recover DB).
So, any ideas or personal experience of implementing something similar?
p.s. I am thinking about timestamp as ID but real ID would be better. Am not sure why I think this – if I am wrong, please correct me.
Thank in advance to everyone!
Is that a requirement than the ID is an integer? If not, then why not just use UUIDs (RFC 4122)? Random UUID should be good enough for your purpose, I guess.