I'm developing an application which uses MySQL database. The application has grown to a point where it runs on more PCs on same network and has one central database running on server. All data are shared between the server and the PCs. I made synchronization that works from server to PCs, but I'm having some trouble synchronizing new data back because of unique primary keys.
For now I use composite primary key solution, where every distributed PC and DB has certain ID and the ID is composited in the primary key with other ID being incremented. I would like to be able to generate unique ID from the application before inserting to the DB and to be able easily synchronize new data to the server. I read a lot about UUIDs and its problem with clustering in databases. My question is what is the best and correct way to solve distributed database synchronization and collisions with primary keys?
One way I thought of what if I had one int primary auto-increment key just for clustering only and second unique key UUID binary(16) column for identification and foreign key relationships? Would be the appending performance better?
Thank you.