News for hackers. Stuff that matters.
Re:Use links not keys to represent relationships in APIs by dragonwriter on Sunday May 12, 2019 @05:36AM (#19890973)
> If you have to honor all previously-issued URL

You don't have to honor it forever; if you want to be good about planning for changes, you annotate each link with the latest date when it is guaranteed not to be expired, and the latest date an updated authoritative URL will be available (either as content in the resource representation or an HTTP redirect) if it expires on the earliest possible date. Consumers are then free to determine whether they need to update links or whether the data from which they come is stale (if your resources at any given link are immutable but for metadata about currency and links to updated versions if the content of the logical entity has changed, so that you can always recover the same version of an entity you fetched at the original URL so long as the URL hasn't expired, clients don't even need to check each references URL for updates, they can just check the base URLs of the entities they already have read that referenced them, and in the process update all referenced URLs; you kind of need that allow clients an approximately consistent view of data when they can't read it all simultaneously anyway, and if your API doesn't need that level of consistency, it then it certainly doesn't need link stability, either—you’ver already decided you are dealing with fundamentally ephemeral data,.so.if people don't follow links relatively quickly, they aren't getting meaningful data even if the links are permanently stable.)

Re:Use links not keys to represent relationships in APIs by bpicolo on Sunday May 12, 2019 @08:44AM (#19891545)
> you annotate each link with the latest date when it is guaranteed not to be expired

If I were paying someone for access to such an API, I would do everything in my power to change providers. Tracking link expiration would be a terrible developer experience. Such a thing may be a sound design for a system, but it's not a good design.

Providers like Twilio and Stripe have been largely successful because they've aimed for making developer experience as non-sadistic as possible.

Re:Use links not keys to represent relationships in APIs by jhayward on Sunday May 12, 2019 @09:31AM (#19891766)
Anyone who has maintained a database such as a customer database knows that it needs to be constantly tested and updated to track changes in e.g., telephone, email, billing, or delivery addresses.

What's different about this proposal? It would seem to acknowledge and support that type of activity directly, rather than through ad-hoc and kludge type mechanisms that typically include paying somewhat shady 3rd-party services.