I'm in a situation where we have a new release of software coming out that's going to use a separate database (significant changes in the schema) from the old. There's going to be a considerable period of time where both the new and the old system will be in production and we have a need to ensure that there are unique IDs being generated between the two databases (we don't want a row in database A to have the same ID as a row in database B). The databases are Sybase.
Possible solutions I've come up with:
- Use a data type that supports really large numbers and allocate a range for each, hoping they never overflow.
- Use negative values for one database and positive values the other.
- Adding an additional column that identifies the database and use the combination of that and the current ID to serve as the key.
- Cry.
What else could I do? Are there more elegant solutions, someway for the two databases to work together? I believe the two databases will be on the same server, if that matters.