DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • From APIs to Actions: Rethinking Back-End Design for Agents
  • Level Up Your API Design: 8 Principles for World-Class REST APIs
  • API Design First: AsyncAPI in .Net
  • Rate Limiting Strategies for Efficient Traffic Management

Trending

  • Introduction to Tactical DDD With Java: Steps to Build Semantic Code
  • Exactly-Once Processing: Myth vs Reality
  • From APIs to Actions: Rethinking Back-End Design for Agents
  • Stateless JWT Auth Microservice Architecture With Spring Boot 3 and Redis Sentinel
  1. DZone
  2. Data Engineering
  3. Databases
  4. Hyrum's Law: What It Means for API Design and Management

Hyrum's Law: What It Means for API Design and Management

If things can get complicated, they will. What are the benefits of freedom in API design, and how can you mitigate the risks of that independent growth?

By 
Erik Wilde user avatar
Erik Wilde
·
Mar. 04, 21 · Analysis
Likes (6)
Comment
Save
Tweet
Share
9.9K Views

Join the DZone community and get the full member experience.

Join For Free

api design management hyrum

The Promise and Challenges of Loose Coupling

APIs should be built around the idea of loose coupling – that providers and consumers of services possess more independence and autonomy to evolve. The obvious advantage of this approach is that it requires less time-consuming coordination, and thus allows providers and consumers to evolve independently.

However, independent growth presents an increased risk of breaking changes. Will existing API consumers have to adapt to every development? Or can they continue using the API in an unaltered state? 

Designing your APIs with extensibility will help manage this problem. An extensible API will continue to grow while still remaining accessible to all current and previous users.



Hyrum's Law: Murphy's Law for APIs

Hyrum's Law is named after Google software engineer Hyrum Wright. For the uninitiated, Murphy's Law states that if something can go wrong, it will. Likewise, Hyrum's Law follows that even if you design your API for extensibility, an API with many active users will likely grow to depend on the wrong aspects. Hyrum's Law says:

With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.

This presents a conflict of interest. An API creates value through its use, so more users will increase its value. However, Hyrum's Law posits that as more users adopt the API, it will undergo more changes. These will negatively affect the overall userbase who, in theory, shouldn't have been impacted by individual changes. 

Now What?

Where does this leave us? We want a unified and consistent experience for users, but we also still desire loose coupling. Google relied on a highly sophisticated solution that used the entire codebase (available in a mono-repository) and created tools to serve both providers and consumers of APIs.

While Google's scale and polish may present unrealistic goals for most other developers and architects, their strategies and methods still provide an interesting case study that may inspire similar strategies on a smaller scale.

If you're interested in more background and a closer look at what Google does, Check out the below conversation with Hyrum Wright to learn more about Hyrum's Law, how Google addresses the challenges it creates, and the recently published book "Software Engineering at Google: Lessons learned from Programming Over Time" (Titus Winters, Tom Manshreck, and Hyrum Wright, March 2020, O'Reilly). 


If you liked this video, why don't you check out Erik's YouTube channel for more "Getting APIs to Work" content?

API Law (stochastic processes) philosophy Design

Published at DZone with permission of . See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • From APIs to Actions: Rethinking Back-End Design for Agents
  • Level Up Your API Design: 8 Principles for World-Class REST APIs
  • API Design First: AsyncAPI in .Net
  • Rate Limiting Strategies for Efficient Traffic Management

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook