Generate unique numbers for use as database keys in distributed applications