$30 off During Our Annual Pro Sale. View Details »
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
96
Other Decks in Technology
See All in Technology
業務のトイルをバスターせよ 〜AI時代の生存戦略〜
staka121
PRO
2
190
re:Inventで気になったサービスを10分でいけるところまでお話しします
yama3133
1
120
今年のデータ・ML系アップデートと気になるアプデのご紹介
nayuts
1
380
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
210
多様なデジタルアイデンティティを攻撃からどうやって守るのか / 20251212
ayokura
0
450
MLflowダイエット大作戦
lycorptech_jp
PRO
1
120
GitHub Copilotを使いこなす 実例に学ぶAIコーディング活用術
74th
3
3.1k
Kiro Autonomous AgentとKiro Powers の紹介 / kiro-autonomous-agent-and-powers
tomoki10
0
480
RAG/Agent開発のアップデートまとめ
taka0709
0
180
Lambdaの常識はどう変わる?!re:Invent 2025 before after
iwatatomoya
1
530
2025年 開発生産「可能」性向上報告 サイロ解消からチームが能動性を獲得するまで/ 20251216 Naoki Takahashi
shift_evolve
PRO
1
150
Edge AI Performance on Zephyr Pico vs. Pico 2
iotengineer22
0
150
Featured
See All Featured
Scaling GitHub
holman
464
140k
Embracing the Ebb and Flow
colly
88
4.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
730
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Being A Developer After 40
akosma
91
590k
Practical Orchestrator
shlominoach
190
11k
How to Ace a Technical Interview
jacobian
280
24k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
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!