Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Operational API Design Anti-Patterns
Search
Jason Harmon
October 26, 2016
Technology
0
210
Operational API Design Anti-Patterns
Talk from Nordic APIs Platform Summit in Stockholm, Oct 2016
Jason Harmon
October 26, 2016
Tweet
Share
More Decks by Jason Harmon
See All by Jason Harmon
Pragmatists Guide to Hypermedia
jharmn
0
97
Other Decks in Technology
See All in Technology
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
630
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.3k
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
700
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.3k
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.7k
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.8k
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.2k
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
180
AI駆動PjMの理想像 と現在地 -実践例を添えて-
masahiro_okamura
1
110
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
120
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
What's in a price? How to price your products and services
michaelherold
247
13k
Leo the Paperboy
mayatellez
4
1.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
300
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
Evolving SEO for Evolving Search Engines
ryanjones
0
120
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
The Spectacular Lies of Maps
axbom
PRO
1
520
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
84
My Coaching Mixtape
mlcsv
0
47
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!