0
simedbn created
Hello,
What is the pros and cos for using int or long over GUID in the entity ?
Thank you in advance
2 Answer(s)
-
0
Google says: <a class="postlink" href="https://www.exceptionnotfound.net/integers-vs-guids-the-great-primary-key-debate/">https://www.exceptionnotfound.net/integ ... ey-debate/</a>
-
0
Nice share, @BBakerMMC. "Google says" is a bit misleading though, more like "Google gives this link".
I would like to share a set of examples:
- int: "Categories" of Items (many Items to one Category)
- long: "Items" that any user can create
- Guid: "Notifications" that are system-generated when an event occurs on an Item (many Notifications to one Item)
Deal breakers from the article:
- You DON'T want your URLs to be "hackable" by your end-users (or can't do proper permission checking on ids) → Guid
- You need to be able to combine data from difference sources with little-to-no chance of duplicate GUIDs → Guid
- sequential integers may give away other information (from a comment on the article) → Guid