Hi, I’m looking into switching my resources to use binary_id’s for the key (see https://hexdocs.pm/ecto/Ecto.Schema.html). This is because this would give me unpredictable urls which could be shared even for ‘private’ resources. i.e. they are undiscoverable on the site but public if you know the URL.
The benefits of plain ids I can see are:
- predictable (easier for testing, user discovery/scraping)
- shorter urls
- less initial setup (out-of-the-box behaviour with ecto/phoenix)
- sense of history from url i.e roughly when the resource was created
The downsides:
- predictable (easier for testing, user discovery/scraping)!
What do you all think? Are there any other downsides to switching from :id primary keys? (Apart from a small performance cost). And what do you use?