9

Why is better to use an UUID to store unique id values? What are the benefits?

Adrian Toman
  • 11,316
  • 5
  • 48
  • 62
Simone
  • 233
  • 1
  • 8
  • possible duplicate of [Advantages and disadvantages of GUID / UUID database keys](http://stackoverflow.com/questions/45399/advantages-and-disadvantages-of-guid-uuid-database-keys) – Dirk Vollmar Nov 04 '10 at 14:43
  • Why was this question up-voted twice? – laurent Jun 09 '12 at 05:02

1 Answers1

9

Two reasons.

A regular ID is only unique within your table inside of your system. If you ever need to integrate systems there is going to be conflict. UUID is guaranteed to be unique across systems.

A second reason is often you don't want people to know how many records you have in your system. If you have an id with 1,2,3,4,5,6,ect someone can easily figure out how big or small your system is.

zgirod
  • 4,189
  • 3
  • 28
  • 36