This topic is not exactly a problem, but a discussion.
We here are implementing a huge system, with many entities. One of our development decisions is that we'll have a superclass for every single entity in the system. All our entities will extend this superclass, named SuperEntity.
The id for every single entity is to be defined in the SuperEntity, and every entity will inherit it. We here are wondering what would be the best generator strategy to be used in a case like this. We are using Oracle 10g.
Our possible strategies are:
- uuid
- sequence
- increment
- hilo
- native (uses sequence)
In your opinion, what would be disadvantages and advantages from each table?
Sequence, when defined in a superclass, uses a single counter for every entity, so we are afraid that we might get close to its limit.
Increment is not threadsafe, as i previously read here, but the counter is per each entity, which is more desirable.
Thank you for any answer,
Chico Science
|