Skip to main content
deleted 2 characters in body
Source Link
Mointy
  • 119
  • 5

I read a lot about using ongoing numbers vs UUID'sUUIDs as the primary key and had an idea how it might be possible to combine both and profit from their advantages, without their disadvantages.

The table would have an id column that is auto-incremented and another column that contains a random string [A-Za-z0-9].

A blog article URL would look like this:

https://myexampleblog.com/article/236424.As5df8

This way the number is used for lookup and the string is used to check if it is someone trying to randomly guess URL'sURLs by incrementing the id.

Is this worth implementing, are there any flaws that I am missing?

I read a lot about using ongoing numbers vs UUID's as the primary key and had an idea how it might be possible to combine both and profit from their advantages, without their disadvantages.

The table would have an id column that is auto-incremented and another column that contains a random string [A-Za-z0-9].

A blog article URL would look like this:

https://myexampleblog.com/article/236424.As5df8

This way the number is used for lookup and the string is used to check if it is someone trying to randomly guess URL's by incrementing the id.

Is this worth implementing, are there any flaws that I am missing?

I read a lot about using ongoing numbers vs UUIDs as the primary key and had an idea how it might be possible to combine both and profit from their advantages, without their disadvantages.

The table would have an id column that is auto-incremented and another column that contains a random string [A-Za-z0-9].

A blog article URL would look like this:

https://myexampleblog.com/article/236424.As5df8

This way the number is used for lookup and the string is used to check if it is someone trying to randomly guess URLs by incrementing the id.

Is this worth implementing, are there any flaws that I am missing?

edited tags; edited title
Link
lennon310
  • 3.2k
  • 7
  • 18
  • 35

better Better than ongoing integer and uuid as primary key

Source Link
Mointy
  • 119
  • 5

better than ongoing integer and uuid as primary key

I read a lot about using ongoing numbers vs UUID's as the primary key and had an idea how it might be possible to combine both and profit from their advantages, without their disadvantages.

The table would have an id column that is auto-incremented and another column that contains a random string [A-Za-z0-9].

A blog article URL would look like this:

https://myexampleblog.com/article/236424.As5df8

This way the number is used for lookup and the string is used to check if it is someone trying to randomly guess URL's by incrementing the id.

Is this worth implementing, are there any flaws that I am missing?