Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Operational API Design Anti-Patterns
Search
Jason Harmon
October 26, 2016
Technology
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Operational API Design Anti-Patterns
Talk from Nordic APIs Platform Summit in Stockholm, Oct 2016
Jason Harmon
October 26, 2016
More Decks by Jason Harmon
See All by Jason Harmon
Pragmatists Guide to Hypermedia
jharmn
0
100
Other Decks in Technology
See All in Technology
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
240
Code4Lib JAPANカンファレンス2026 開会挨拶 / Code4Lib JAPAN Conference 2026: Opening Remarks
ykiyota
0
300
Where Is JetBrains AI Heading- — Central CLI, Air Alpha, and the Agentic Development Stack
x5gtrn
PRO
0
150
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
1
220
ペアプロの価値はコードを書くことだけじゃない
codmoninc
PRO
0
160
あるけみー式LTスライド作成術
alchemy1115
1
150
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
120
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
3
890
KPIだけでは評価できないプロダクトが考えるべき Evalsという第二の評価系 / Beyond KPIs: Evals as a Second Evaluation Framework for Products #PdEConf
aki_iinuma
4
3.8k
AI時代のAPI品質を支えるガードレール / API Guardrails for API quality in the AI era
yokawasa
1
210
リージョンの壁を越える、 ちょっと変わったAWSサービスの話
falken
PRO
1
300
Reactの設計論
uhyo
14
7.1k
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
3
500
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Deep Space Network (abreviated)
tonyrice
0
300
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Designing for humans not robots
tammielis
254
26k
Embracing the Ebb and Flow
colly
88
5.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How GitHub (no longer) Works
holman
316
150k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
480
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
520
The World Runs on Bad Software
bkeepers
PRO
72
12k
Transcript
Operational API Design Anti-Patterns Jason Harmon @jharmn @typeform
Head of APIs @Typeform • Leading microservice replatform • Leading
developer focused initiatives Previous API experience: • PayPal/Braintree • uShip • Wayport / AT&T Jason Harmon • Old blogs at: ◦ APIUX.com ◦ Pragmaticapi.com
“API Design Anti-Patterns” talk from last year • https://www.youtube.com/watch?v=lotdj-ry8YA Design
issues don’t always cause operational issues. Haven’t we already talked about this?
Usability issues Operational issues
HTTP GET instead of POST
Landing GET /landing 200 OK { “Token”: “abc123” } User
Human
A Form User Human
Submit User Human
Submit User Human Click “Back” ? Submit needs to have
a landing (to derive “response rate”) POST /submissions (+landing_id in body)
Issue: GET Caches + HTTP GET GET /landing Caching Proxy
Or CDN Cached response X 200 OK { “Token”: “abc123” }
Landings: Better User Human POST /landing 200 OK { “Token”:
“abc123” }
• Identification: Unexpected cached API calls from browser/proxy/etc • Solution:
Use POST • Live already? ◦ Just add POST ◦ Add ?cache_buster=[random] to GET Summary: GET instead of POST
Polling APIs
Polling APIs Problem Identification: • Large dataset • Expensive queries
• Frequently changing data • Lots of clients Client app Every 5 mins Thousands of forms
Solution: Webhooks Client app Register URL New data = POST
Still needed for missing data
WHAT IF THIS IS ALREADY HAPPENING!!?! Client app Options: •
Launch webhooks! • Caching (if possible) • Read-only DB replica • Cheaper query to check for new data before retrieval
Rigid Hierarchy
Microservices structure: Forms
Issue: Many calls Microservices
Form Structure + Backend-for-Frontend Microservices B F F AKA •
Composition • Orchestration GraphQL is another potential option
• Problem: ◦ Client performance in UX ◦ N+1 calls
(client calls for parent, then calls for related/child items) • Identification: ◦ Data lacking in main resource, usually for UX devs. • Easy to add in live scenarios Summary: Rigid resource structure
Generic Actions
AKA RPC Commonly used in controlled state transitions: POST /forms/:id/publish
{ “comment”: “It’s the right time” } What’s an “action”
Perform multiple actions with one endpoint POST /forms/:id/change-status { “action”:
“publish”, “comment”: “My favorite version of this form” } Generic “action”
Product Owner - Any performance issues? Devs
Product owner: - So how many “publish” actions happened? Devs
TO THE LOGS!
Dear Product Owner. We need to build a new metrics
system to answer that question. - Yours truly, dev team. PO
Product Owner’s reply:
Cheap visibility is a good thing
Generic Actions • Identification: ◦ POST /resource/:id/generic-name + {action: process}
• Problem: “Protocol tunneling”: ◦ Lack of traceability, more work for metrics (vs cheaper HTTP logs method) • Solution: ◦ POST /resource/:id/action-name • Already live? ◦ ?action=name in optional query parameter
API Design Takeaways
Use cases first, then design.
Design can influence performance.
Structure is good, but be prepared to blur the lines.
Design can put out fires.
Don’t forget the logs.
That’s it!