Consider the following sample table in MySQL:
CREATE TABLE transactions
(
transId BIGINT NOT NULL AUTO_INCREMENT,
transDate DATETIME NOT NULL,
transTotal DECIMAL(10,2),
PRIMARY KEY (transId)
);
This table is used in high volume operations i.e. lots of INSERTS. You will eventually reach the maximum limit of transId. (Of course in reality BIGINT offers pretty much larger range.)
What are the possible strategies to prevent this and not worry about roll-over issues that would break your application.
- Would UUID as primary be the solution?