My App Broke. . . And it's the API's fault.

A presentation at API World in September 2018 in San Jose, CA, USA by Shy Ruparel

Slide 1

Slide 1

My App Broke And it’s all the API’s fault

Slide 2

Slide 2

Shy Ruparel Developer Evangelist | Contentful @ShyRuparel He/Him

Slide 3

Slide 3

Don’t let a CMS get in the way of shipping software. Contentful provides a content infrastructure that enables teams to power content in any digital product.

Slide 4

Slide 4

Let’s talk about Software Engineering

Slide 5

Slide 5

Regardless of what you make Something is gonna break

Slide 6

Slide 6

Stuff breaks

Slide 7

Slide 7

Slide 8

Slide 8

Use APIs Writes APIs

Slide 9

Slide 9

How do we Minimize risk?

Slide 10

Slide 10

If you can change an API In a way that breaks your codebase

Slide 11

Slide 11

And you can’t make that change programmatically

Slide 12

Slide 12

Slide 13

Slide 13

Let’s take a look at Databases

Slide 14

Slide 14

DON’T FUCK IT UP Critical to business Store user data In Sync with Codebase Outages translate to $$ lost

Slide 15

Slide 15

Production should be Non-Trivial to change

Slide 16

Slide 16

Fun Fact: SQL is 44 years old

Slide 17

Slide 17

Database Migrations No more developers manually alternating a DB Schema alterations as code Version Control for Migrations Repeatable and Testable

Slide 18

Slide 18

Cool. Can we talk about APIs again?

Slide 19

Slide 19

Slide 20

Slide 20

Slide 21

Slide 21

Can we learn anything from Continuous Integration?

Slide 22

Slide 22

Simple CI Pipeline Build Test Deploy

Slide 23

Slide 23

WHAT CI DOES • Forces testing and checks on changes • Automates deployment • Cancelable • Repeatable

Slide 24

Slide 24

Saves Time Creates Trust

Slide 25

Slide 25

Process is key

Slide 26

Slide 26

Ok. Now we can talk about External APIs

Slide 27

Slide 27

Slide 28

Slide 28

Treat APIs like Databases

Slide 29

Slide 29

MAKE PRODUCTION NON-TRIVIAL TO EDIT

Slide 30

Slide 30

WRITE/ENABLE PROGRAMMATIC API MIGRATIONS

Slide 31

Slide 31

API KEYS FOR EVERY BRANCH

Slide 32

Slide 32

Automate your changes via Continuous Integration

Slide 33

Slide 33

TEST YOUR APIS

Slide 34

Slide 34

MAKE CHANGE PART OF DEPLOYMENT

Slide 35

Slide 35

Less Simple CI Pipeline Build - Use Branch API Key - Implement API Configuration Changes Test - Run tests that use that API Deploy - Update Production API Key

Slide 36

Slide 36

Let’s look at a practical Workflow

Slide 37

Slide 37

Slide 38

Slide 38

Shy Ruparel @ShyRuparel github.com/shy/talks Image Credits wocintechchat.com Kim’s Convenience XKCD