Let's say I'm building a Facebook clone in Rails
Currently my routes are pretty standard, like
/group/1/post/3
I'd love to make some synthetic ID's using the same numbering scheme that sites like Facebook use. There seem to be two general types of routes
# Only numbers
/group/10101830214008379/post/159476674458072
# Hash / Hex
/group/da295c4b/post/815fe818
Outside of aesthetics -
- What are some advantages/disadvantages to using either approach?
- Is there a good industry standard or best practice for generating synthetic ids for concepts like users, groups, posts, etc..
- What's the best way in Ruby/Rails to generate each of these IDs? I know of
SecureRandom.hex
but that seems to generate a long hash.
Thanks!