Overview
This article discusses the development of API versioning for LinkedIn Marketing APIs, highlighting the challenges faced with unversioned APIs and the principles guiding the new versioning system. It details the legacy architecture, the new architecture, and the key components of the API Gateway and mid-tier, emphasizing the importance of a smooth developer experience.
What You'll Learn
1
How to implement API versioning to improve developer experience
2
Why versioning APIs is crucial for managing breaking changes
3
When to apply decoupling in API design for better flexibility
Key Questions Answered
What are the core principles of LinkedIn API versioning?
The core principles include 'Slow is smooth, and smooth is fast', 'Future-first architecture', 'API first', 'Don’t disrupt customers', and 'Decoupling'. These principles guide the design and implementation of the API versioning system to enhance developer experience and ensure stability.
How does the new architecture for LinkedIn APIs improve upon the legacy system?
The new architecture isolates external applications from changes by exposing APIs under specific versions, allowing partners to migrate at their own pace. Each API product is served through a dedicated mid-tier that integrates with various backends, ensuring a smoother transition and better management of API changes.
What role does the API Gateway play in LinkedIn's API versioning?
The API Gateway is responsible for handling versioned API requests from external applications. It validates versions, maps requests to internal resources, and manages authentication, throttling, and request dispatching, ensuring a secure and efficient API interaction.
What challenges did LinkedIn face with unversioned APIs?
LinkedIn faced challenges such as frequent breaking changes, unpredictable release schedules, and difficulties for developers in testing and planning their roadmaps. This led to a need for a structured API versioning system to enhance stability and predictability.
Technologies & Tools
Backend
Rest.li
Rest.li services are utilized for internal service implementation and routing requests in the legacy architecture.
Key Actionable Insights
1Implementing API versioning can significantly enhance the developer experience by providing stability and predictability.As seen in LinkedIn's approach, versioning allows developers to plan their integrations without the fear of sudden breaking changes, which can disrupt their workflows.
2Adopting a 'Future-first architecture' principle ensures that current decisions benefit long-term product development.This principle encourages teams to think ahead, making choices that will facilitate future enhancements and avoid technical debt.
3Decoupling internal and external APIs can lead to more flexible and maintainable systems.By allowing these APIs to evolve independently, organizations can implement changes without impacting external partners, thus improving overall system resilience.
Common Pitfalls
1
Failing to consider the impact of breaking changes on external developers can lead to significant disruptions.
This often occurs when teams prioritize rapid development over stability, resulting in a chaotic environment for partners who rely on predictable API behavior.