cloud.google.com · Saved

API design: Why you should use links, not keys, to represent relationships in APIs | Google Cloud Blog

cloud.google.com/blog/products/application-development/api-design-why-you-should-use-links-not-keys-to-represent-relationships-in-apis

What Jamie wrote

I am a fan of this concept and have advocated for it in platforms for a while, particularly large and complicated platforms, which most are.

Viewed from an implementation point of view, replacing all the database keys with links is a fairly simple change—the server converted the database foreign keys into URLs so the client didn't have to—but it significantly simplifies the API and reduces the coupling of the client and the server. Many URI templates that were essential for the first design are no longer required and can be removed from the API specification and documentation.

Think of your platform as a little web (lowercase w) of it’s own, and using links to establish the relationships. 🔗