This is a best practice question for a potentially large database.
I have a Table exposed to a public API which will store a UUID associated with each row. This UUID is the only way the public will be able to search the data within the table.
A UUID is used externally, as internally there is no need for an incremental ID, and it provides an additional layer of security for the data. This row is not referenced anywhere else in the database.
Initially, I created the table without an auto-increment (int) ID column, and instead, made the BINARY(16) UUID column the Primary Key.
However, I have been doing some more reading, and saw an opinion that in a large dataset, the storage and IOps of a non-sequential Primary Key increase exponentially over just using a sequential Primary Key, as the insert method needs more operations to find the correct row on the B+ Table.
I'm not savvy in the internal workings of MySQL/InnoDB, so my question is:
Would it be "better", to have an auto-increment INT(4)/BIGINT(8) Primary Key -- AS WELL AS -- a BINARY(16) Unique Key == or == Just use the non-incremental BINARY(16) as the Primary Key, when facing potentially large dataset?
Thanks, JP