I'm looking for a way to generate unique integer IDs for my customers, very similar to how StackOverflow/StackExchange generates one for each question. The challenge is making this number unique in a distributed system since multiple databases are used, which means that the auto increment feature cannot work.
I have to assume that a huge site like StackOverflow/StackExchange is distributed, so I would very much like to know how it's able to generate a unique integer without any collisions.
From what I've seen, the two kinds of implementations around are Flickr's ticket server approach, but that creates a single point of failure, or Twitter's Snowflake, but that generates a 64 bit number, whereas StackOverflow's seems to be much smaller.