Is it bad practice to use "Guid" and "int" for the same bank?

Asked

Viewed 117 times

4

In a project I’m developing I prioritize the use of Guid for PK because of the ease for me, but it has a table that would be more advantageous to use int. This is wrong?

  • By default I would choose between one or the other for the whole bank. The question that Maniero left the link in his reply answers the subject well.

1 answer

6


Right or wrong depends on context, there is no magic answer that can always or can never. You have to ask yourself what problems you expect to have? And why do you need to mix things up? And why did you use GUID before? Was it no longer a wrong decision? It has advantages, but have the disadvantages been observed? And why now needs another way?

It’s okay to use primary keys with different ways from a database point of view, you just need to see if it’s a problem for your application. If you don’t know very well what you’re doing with it can be a problem, and only you know it (or neither do you).

There is a question that talks more about the subject: Should I use GUID or int as the primary key?.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.