Death By a Thousand API Versions
Stanislav Zmiev
API-First
2
It all comes back to Stripe
*Note that I am not associated with Stripe and am only using the publicly available information
3
It all comes back to Stripe
*Note that I am not associated with Stripe and am only using the publicly available information
4
API-First
5
API-First
6
API-First
7
Let’s make an API!
8
What about multiple addresses?
9
What about multiple addresses?
10
What about multiple addresses?
11
What about multiple addresses?
12
What about multiple addresses?
13
What about multiple addresses?
14
What about multiple addresses?
15
Okay, so how do we version?
1.2.3-beta
16
Okay, so how do we version?
1.2.3-beta
2022-11-16
17
Okay, so how do we version?
1.2.3-beta
2022-11-16
Monite-Version: 2022-11-16
18
Wait, but how do we actually version?
19
How solutions are categorized
20
Isolation of old versions from new bugs
Simplicity of implementation and learning
Ease of maintenance
Solution 0: GraphQL
21
Isolation
Simplicity
Ease of Maintenance
Solution 1: Load balancing
22
Isolation
Simplicity
Ease of Maintenance
Solution 2: Single-deployment full app duplication
23
Isolation
Simplicity
Ease of Maintenance
Solution 3: Single-app route duplication
24
Isolation
Simplicity
Ease of Maintenance
Solution 4: Conversion layer
25
Isolation
Simplicity
Ease of Maintenance
But we needed something even more scalable
26
What else can we do?
27
Isolation of old versions from new bugs
Simplicity of implementation and learning
Ease of maintenance
What else can we do?
28
Isolation of old versions from new bugs
Simplicity of implementation and learning
Ease of maintenance
Improved by automated testing
What else can we do?
29
Isolation of old versions from new bugs
Simplicity of implementation and learning
Ease of maintenance
Improved by automated testing
Improved by longer onboarding for new hires
What else can we do?
30
Isolation of old versions from new bugs
Simplicity of implementation and learning
Ease of maintenance
Improved by automated testing
Improved by longer onboarding for new hires
Improved by hiring more people
Let’s get back to the basics
31
Databases have versions
Repositories have versions
Solution 5: Migration-based versioning
32
twitter.com/brandur
Isolation
Simplicity
Ease of Maintenance
Solution 5: Migration-based versioning
33
Isolation
Simplicity
Ease of Maintenance
Cadwyn Version Changes
34
Cadwyn versions
35
Cadwyn is not only about FastAPI!
36
So what do you choose?
37
Less
More
Migrate requests and responses like Cadwyn and Stripe
Copy single routes and small pieces of business logic
Deploy versions separately
Thank you!
38
zmievsa@gmail.com
t.me/zmievsa
github.com/zmievsa
twitter.com/zmievsa
linkedin.com/in/zmievsa