Using UUID as unique value for id, instead a numeric sequential value, or both

Hi.
UUID as unique value it’s more secure as value for unique id.
But the clients is used to seeing sequential numbers as unique key

Example for table country: (How the user likes)
0001 MyCountry
0002 Your Country
0003 Other Country

With UUID (more secure)
5aa82b14-9f3a-11ec-b909-0242ac120002 MyCountry
5aa82ede-9f3a-11ec-b909-0242ac120002 Your Country
5aa83032-9f3a-11ec-b909-0242ac120002 Other Country

If I want to do both, it would be something like
5aa82b14-9f3a-11ec-b909-0242ac120002 0001 MyCountry
5aa82ede-9f3a-11ec-b909-0242ac120002 0002 Your Country
5aa83032-9f3a-11ec-b909-0242ac120002 0003 Other Country

Does it make sense to have two fields with unique values?
One to “display” to the User and one for the database specifically?

But I also think that I will use multitenant and rest where UUID is very important .

What do you think ?

We usually do this - we use a UUID for the database and a separate ID of a simple format if it needs to be shown to a “normal user”.

3 Likes