Home About Archives Search Feed


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

🔒 cloud.google.com

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. 🔗

Posted on May 14, 2019








← Next post    ·    Previous post →