My understanding is that the generated id needs to be globally unique and locally (process-wise) incrementing. Though the latter is true, there are cases when the former might not hold. For example, if the Cloud Foundry Runner hosting the application were to lose connectivity the health management system of Cloud Foundry, it is possbile that Cloud Foundry spawns a duplicate application - in which case the produced IDs would be differentiated only by moment.now().
At this point in time this is purely hypothetical and I don't have a real-life occurance example of that, but looking at the code I decided to bring it up.
Hi,
The id generated by the
seqid
package is not guaranteed to be unique: https://github.com/cloudfoundry-incubator/cf-abacus/blob/94ce220b6217380a52644697fce48dbf981c30d4/lib/utils/seqid/src/index.js#L25-L40My understanding is that the generated id needs to be globally unique and locally (process-wise) incrementing. Though the latter is true, there are cases when the former might not hold. For example, if the Cloud Foundry Runner hosting the application were to lose connectivity the health management system of Cloud Foundry, it is possbile that Cloud Foundry spawns a duplicate application - in which case the produced IDs would be differentiated only by
moment.now()
.At this point in time this is purely hypothetical and I don't have a real-life occurance example of that, but looking at the code I decided to bring it up.