I\'ve generally implemented sequence number generation using database sequences in the past.
e.g. Using Postgres SERIAL type http://www.neilconway.o
One solution that is decent is to use a long time based generation. It can be done with the backing of a distributed database.