Open Tirokk opened 4 years ago
Authored by Tirokk
You will say the benefit is something shorter?
But than the uniqueness is not safe and for me that is absolut necessary. Because it is important to use the link in the outer world !
Is the database ID to long? Than lets generate a shorter one that increases: 1, 2, 3, … … but unique.
Authored by appinteractive
Never use numeric ids, ever as they do not scale at all. Our UUIDs in the other hand are 36 chars long, to long in my opinion for the links. Just save a short version to them and do a fallback an the slug?
Authored by appinteractive
First, numeric values are always a security issue as they can be guessed and brute forces which might end up in unexpected behavior or attacks by script kiddies.
Also can it be problematic in situations where you have several servers running in parallel wanting to write at the same time producing the same ids. I read a good article by someone from eBay about issues they had with something like that. But that obviously depends on the database you are using.
In my opinion we should avoid numeric ids at all costs where not necessary.
Authored by Tirokk
There are the following important things to this kind of UUIDs in my eyes @appinteractive @roschaefer :
What is if we generate such UUIDs separately by a sole service which just counts – may it counts separately for each user, post etc. – and is not related to the database at all? The database just stores this UUIDs. Than it can be very quick and can not be related to safety issues with the database. Or I’ve been taken wrong?
If Twitter, stackoverflow etc. do it, there must be a save and good way …
Authored by Tirokk
In our discussion @appinteractive had the solution to encode or to compress the UUID somehow to get a non numeric and short URL-ID:
Authored by appinteractive
We could use nanoid instead of uuid for url friendly ids. https://github.com/ai/nanoid
Authored by appinteractive
The other way is to compress our UUIDs for urls https://github.com/oculus42/short-uuid
Authored by stale[bot]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Authored by Tirokk
We should have micro-UUIDs or short-UUIDs in our URLs as standard. The long versions should be possible for compatibility.
Authored by Tirokk
Is the Additional context of the issue fulfilled in your eyes @roschaefer @mattwr18 ? I guess probably not everything, or?
I created an extra issue #2786 for the Short- / Nano-ID …
Authored by stale[bot]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Authored by stale[bot]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe.
Describe the solution you'd like A solution can be a combination of a unique ID for the user, post etc. followed by a human readable part, that can be changed by the user by changing their names or headlines etc.
As an example stackexchange.com uses them: https://webmasters.stackexchange.com/questions/113717/will-having-product-id-in-urls-hurt-seo-compared-to-a-url-with-only-keywords
So for HC it will look like:
https://human-connection/profile/85739/peter-lustig
https://human-connection/post/6976396/distinctio-amet-voluptate/
But there have to be some things considered closely !!! See later …
Describe alternatives you've considered An alternative could be to put the ID at the very end of the slug.
https://human-connection/profile/peter-lustig/85739
But I read that this has the danger to be cut of by algorithms that truncate the URL after 80 chars as an example. And we would have to be aware to limit the headlines of posts somehow.Additional context I have investigate this today more closely after my discussion about this with @roschaefer on Saturday.
If we do so …
The ID may have an impact on the SEO as well. But with this the people are not really sure.