Slide 1

Slide 1 text

Death By a Thousand API Versions Stanislav Zmiev Tech Lead of Platform Engineering Monite

Slide 2

Slide 2 text

About me zmievsa@gmail.com t.me/zmievsa github.com/zmievsa twitter.com/zmievsa linkedin.com/in/zmievsa

Slide 3

Slide 3 text

API-First ● A buzzword? ● A development practice? ● A design paradigm? 3

Slide 4

Slide 4 text

API-First 4

Slide 5

Slide 5 text

API-First 5

Slide 6

Slide 6 text

API-First 6

Slide 7

Slide 7 text

It all comes back to Stripe 7 *Note that I am not associated with Stripe and am only using the publicly available information

Slide 8

Slide 8 text

It all comes back to Stripe 8 *Note that I am not associated with Stripe and am only using the publicly available information

Slide 9

Slide 9 text

Let’s make a good API! 9

Slide 10

Slide 10 text

Let’s make a good API! 1 0

Slide 11

Slide 11 text

What about multiple addresses? 1 1

Slide 12

Slide 12 text

What about multiple addresses? 1 2 1. Extend it!

Slide 13

Slide 13 text

What about multiple addresses? 1 3 1. Extend it! 2. Talk to clients!

Slide 14

Slide 14 text

What about multiple addresses? 1 4 1. Extend it! 2. Talk to clients! 3. GraphQL!

Slide 15

Slide 15 text

What about multiple addresses? 1 5 1. Extend it! 2. Talk to clients! 3. GraphQL!

Slide 16

Slide 16 text

What about multiple addresses? 1 6 1. Extend it! 2. Talk to clients! 3. GraphQL! 4. API Versioning

Slide 17

Slide 17 text

Okay, so how do we version? 1 7 1. Only one dimension 1.2.3-beta

Slide 18

Slide 18 text

Okay, so how do we version? 1 8 1. Only one dimension 2. ISO Dates for versions 1.2.3-beta 2022-11-16

Slide 19

Slide 19 text

Okay, so how do we version? 1 9 1. Only one dimension 2. ISO Dates for versions 3. Versions passed through a custom header 1.2.3-beta 2022-11-16 Monite-Version: 2022-11-16

Slide 20

Slide 20 text

Wait, but how do we actually version? 2 0

Slide 21

Slide 21 text

How solutions are categorized 2 1 Isolation of old versions from new bugs Simplicity of implementation and learning Ease of maintenance

Slide 22

Slide 22 text

Solution 0: GraphQL 2 2 Isolation Simplicity Ease of Maintenance

Slide 23

Slide 23 text

Solution 1: Load balancing 2 3 Isolation Simplicity Ease of Maintenance

Slide 24

Slide 24 text

Solution 2: Single-deployment full app duplication 2 4 Isolation Simplicity Ease of Maintenance

Slide 25

Slide 25 text

Solution 3: Single-app route duplication 2 5 Isolation Simplicity Ease of Maintenance

Slide 26

Slide 26 text

Solution 4: Conversion layer 2 6 Isolation Simplicity Ease of Maintenance

Slide 27

Slide 27 text

What else can we do? 2 7 ● How do we minimize the burden on our developers? ● How do we minimize the burden on our clients? We need a solid compromise

Slide 28

Slide 28 text

What else can we do? 2 8 Isolation of old versions from new bugs Simplicity of implementation and learning Ease of maintenance

Slide 29

Slide 29 text

What else can we do? 2 9 Isolation of old versions from new bugs Simplicity of implementation and learning Ease of maintenance Improved by automated testing

Slide 30

Slide 30 text

What else can we do? 3 0 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

Slide 31

Slide 31 text

What else can we do? 3 1 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

Slide 32

Slide 32 text

Let’s get back to the basics 3 2 Databases have versions Repositories have versions

Slide 33

Slide 33 text

Solution 5: Migration-based versioning 3 3 twitter.com/brandur Isolation Simplicity Ease of Maintenance

Slide 34

Slide 34 text

Solution 5: Migration-based versioning 3 4 Isolation Simplicity Ease of Maintenance

Slide 35

Slide 35 text

Cadwyn Version Changes 3 5

Slide 36

Slide 36 text

Cadwyn versions 3 6

Slide 37

Slide 37 text

Cadwyn is not only about FastAPI! 3 7

Slide 38

Slide 38 text

But is it… 3 8 ● Easy to add a bug to an older version?

Slide 39

Slide 39 text

But is it… 3 9 ● Easy to add a bug to an older version? ● Slow?

Slide 40

Slide 40 text

But is it… 4 0 ● Easy to add a bug to an older version? ● Slow? ● Hard to switch to?

Slide 41

Slide 41 text

Back to conclusion 4 1 - How acceptable is it to introduce a bug into an old version? - How often do you make breaking changes? - How long do you support your versions? Less More Migrate requests and responses like Cadwyn and Stripe Copy single routes and small pieces of business logic Deploy versions separately

Slide 42

Slide 42 text

Questions? 4 2