SlideShare a Scribd company logo
API DESIGN
5 Anti-Patterns
in
Ali @aliostad
Kheyrollahi
API The Art of Presentation
API Iceberg
“This huge mass underneath the water that you can't
see, the private API, is the biggest part of the whole
opportunity.”
Daniel Jacobson, Netflix - 2011
Micro services
“ … the microservice architectural style is an approach to
developing a single application as a suite of small
services, each running in its own process and
communicating with lightweight mechanisms, often an
HTTP resource API”
Martin Fowler - Bliki
@aliostad
REST things
Hypermedia
Layered Architecture
Stateless
Caching
Client-Server
@aliostad
REST Client-Server
@aliostad
HTTP Client-Server
Server Concern: e.g. returning the resource when
requested with a different casing
/car/123 vs /Car/123
Client Concern: e.g. Handling 301 (moved
permanently)
Mixed Concern: e.g. Most HTTP concepts such as
Content Negotiation or Caching/Concurrency
@aliostad
CSDS Client-Server Domain Separation
S e r v e r
@aliostad
CSDS Client-Server Domain Separation
“ Client and server must
define and live within their
own bounded context ”
API Restaurant
5 Anti-Patterns in API Design - DDD East Anglia 2015
@aliostad
CSDS Client-Server Domain Separation
C l i e n t
Can be a server itself1
2 Uses services of server(s) to bring value to end-user (directly or indirectly)
3 Free to take dependency on of Server’s public domain (URI, exchange domain)
Normally keeps state but does not master it4
@aliostad
Client-Server Boundary
Boundary
@aliostad
@aliostad
Anti-Pattern Transparent Server
1
@aliostad
“server exposes its internal
implementation to its clients”
Anti-Pattern Transparent Server
server's private domain or the domain of its underlying
dependencies bleeds into its public API
E x a m p l e 1
Anti-Pattern Transparent Server
@aliostad
E x a m p l e 2
Always for a customer1
2 Only for customers currently shopping
3 Get expired after inactivity
A couple of tables or
a document database
4 Max one basket per customer
Anti-Pattern Transparent Server
@aliostad
E x a m p l e 2
POST /baskets?cid=908
201 Created
Location: /baskets/123435455456
POST /baskets/123435455456
{...}200 OK
x
Anti-Pattern Transparent Server
@aliostad
E x a m p l e 2
POST customer/me/basket
{…}
200 OK
✓
Anti-Pattern Transparent Server
@aliostad
Anti-Pattern Chauvinist Server
2
@aliostad
“designing the API from
server's perspective”
Anti-Pattern Chauvinist Server
Server pushes its thinking and process
to the client
resulting in the client becoming
a subordinate
@aliostad
Anti-Pattern Chauvinist Server
H A T E O A S
Hypermedia
as the Engine
of Application (state)
@aliostad
Anti-Pattern Chauvinist Server
H A T E O A S
Client most likely a server wasteful to navigate2
3 Client uses more than one server
4 Microservices: servers smaller, containing a couple of resources
5 Undefined caching directives for hypermedia
Server hasn’t got a clue what the application is1
@aliostad
Anti-Pattern Demanding Client
3
@aliostad
“client enforces its special
needs onto the API signature”
Anti-Pattern Demanding Client
certain clients limitations (or reluctance to
implement) become server's default behaviour
@aliostad
E x a m p l e s
Anti-Pattern Demanding Client
Client enforces use of query string over HTTP headers1
2 Client pushes for consistency of parameter names with other [external] APIs
3 Client pushes for consistency of behaviour with other [external] APIs
4 Client asks for simpler model since does not need the extra data
@aliostad
Anti-Pattern Assuming Server
4
@aliostad
“server assumes the role of
defining client experience”
Anti-Pattern Assuming Server
server makes decisions on issues that are
inherently client concerns
@aliostad
E x a m p l e 1
Anti-Pattern Assuming Server
GET /api/catalogue/products/pages/1
GET /api/catalogue/products/pages/2
x
@aliostad
E x a m p l e 1
Anti-Pattern Assuming Server
GET /api/catalogue/products?from=1&count=30
✓
@aliostad
E x a m p l e 2
Anti-Pattern Assuming Server
B r o w s e r
s n i f f i n g
@aliostad
Anti-Pattern Presumptuous Client
5
@aliostad
“client takes on responsibilities
that cannot fulfil”
Anti-Pattern Presumptuous Client
Client presumes it can fulfil some responsibilities that are
inherently server’s
@aliostad
E x a m p l e s
Client implements an algorithm that needs to be centralised on server1
2 Client act as an authority for authentication or authorisation
3 Client takes control of cache invalidation
Anti-Pattern Presumptuous Client
@aliostad
Microservices take importance of APIs to a new level1
2 Think of your API as a restaurant and remember the contrast
3 Transparent Server: Exposing internals
Re Cap
4 Chauvinist Server: Client becoming a subordinate
5 Demanding Client: Client enforcing special needs to API signature
6 Assuming Server: Server deciding client experience
7 Presumptuous Client: Client taking responsibilities cannot fulfil
Thank You
@aliostad
http://byterot.blogspot.com

More Related Content

PDF
5 Anti-Patterns in API Design
PDF
5 Anti-Patterns in Api Design - buildstuff
PDF
5 Anti-Patterns in Api Design - NDC London 2016
PDF
5 must-have patterns for your microservice - buildstuff
PDF
5 must have patterns for your microservice
PPTX
Intro to Node.js (German)
PPTX
ESPC19 Power Apps Deep Dive
PPTX
Customizing OpenText Analytics for SaaS Operation
5 Anti-Patterns in API Design
5 Anti-Patterns in Api Design - buildstuff
5 Anti-Patterns in Api Design - NDC London 2016
5 must-have patterns for your microservice - buildstuff
5 must have patterns for your microservice
Intro to Node.js (German)
ESPC19 Power Apps Deep Dive
Customizing OpenText Analytics for SaaS Operation

What's hot (6)

PPTX
IDX API with Antonio
PPTX
Hexagonal architecture with Spring Boot
PPTX
Azure DocumentDB for Healthcare Integration - Part 2
PPTX
Reporting
PPTX
Api Gateway - What's the use of an api gateway?
PDF
MongoDB World 2019: Using the MongoDB Enterprise Kubernetes Operator to Scale...
IDX API with Antonio
Hexagonal architecture with Spring Boot
Azure DocumentDB for Healthcare Integration - Part 2
Reporting
Api Gateway - What's the use of an api gateway?
MongoDB World 2019: Using the MongoDB Enterprise Kubernetes Operator to Scale...
Ad

Similar to 5 Anti-Patterns in API Design - DDD East Anglia 2015 (20)

PDF
Lessons from running AppSync in prod
PDF
PDF
#JaxLondon keynote: Developing applications with a microservice architecture
PDF
Developing Applications with a Micro Service Architecture - Chris Richardson
PDF
Event Driven Architecture with a RESTful Microservices Architecture (Kyle Ben...
PPT
APITalkMeetupSharable
PDF
Resilient Event Driven Systems With Kafka
PDF
Leapfrog into Serverless - a Deloitte-Amtrak Case Study | Serverless Confere...
PDF
Developing applications with a microservice architecture (SVforum, microservi...
PDF
Event-Driven Applications Done Right - Pulsar Summit SF 2022
PDF
Architecting &Building Scalable Secure Web API
PDF
Developing applications with a microservice architecture (svcc)
PDF
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
PDF
Introduction to Stream Processing
PPTX
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
PPTX
In Flux Limiting for a multi-tenant logging service
PDF
Microservices Security: dos and don'ts
PDF
Cloud-native Data: Every Microservice Needs a Cache
PDF
Single Source of Truth for Network Automation
PDF
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
Lessons from running AppSync in prod
#JaxLondon keynote: Developing applications with a microservice architecture
Developing Applications with a Micro Service Architecture - Chris Richardson
Event Driven Architecture with a RESTful Microservices Architecture (Kyle Ben...
APITalkMeetupSharable
Resilient Event Driven Systems With Kafka
Leapfrog into Serverless - a Deloitte-Amtrak Case Study | Serverless Confere...
Developing applications with a microservice architecture (SVforum, microservi...
Event-Driven Applications Done Right - Pulsar Summit SF 2022
Architecting &Building Scalable Secure Web API
Developing applications with a microservice architecture (svcc)
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Introduction to Stream Processing
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
In Flux Limiting for a multi-tenant logging service
Microservices Security: dos and don'ts
Cloud-native Data: Every Microservice Needs a Cache
Single Source of Truth for Network Automation
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
Ad

More from Ali Kheyrollahi (14)

PDF
Autonomous agents with deep reinforcement learning - Oredev 2018
PDF
Buildstuff - what do you need to know about RPC comeback
PDF
Deep learning for developers - oredev
PDF
Microservice Architecture at ASOS - DevSum 2017
PDF
5 must have patterns for your microservice - techorama
PDF
Real time monitoring-alerting: storing 2Tb of logs a day in Elasticsearch
PDF
From Power Chord to the Power of Models - Oredev
PDF
From Hard Science to Baseless Opinions - Oredev
PDF
From hard science to baseless opinions
PDF
Microservice architecture at ASOS
PDF
Us Elections 2016 - Iran Elections 2005
PDF
From power chords to the power of models
PDF
Topic Modelling and APIs
PDF
Http caching 101 and a bit of CacheCow
Autonomous agents with deep reinforcement learning - Oredev 2018
Buildstuff - what do you need to know about RPC comeback
Deep learning for developers - oredev
Microservice Architecture at ASOS - DevSum 2017
5 must have patterns for your microservice - techorama
Real time monitoring-alerting: storing 2Tb of logs a day in Elasticsearch
From Power Chord to the Power of Models - Oredev
From Hard Science to Baseless Opinions - Oredev
From hard science to baseless opinions
Microservice architecture at ASOS
Us Elections 2016 - Iran Elections 2005
From power chords to the power of models
Topic Modelling and APIs
Http caching 101 and a bit of CacheCow

Recently uploaded (20)

PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Trending Python Topics for Data Visualization in 2025
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Custom Software Development Services.pptx.pptx
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
chapter 5 systemdesign2008.pptx for cimputer science students
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
STL Containers in C++ : Sequence Container : Vector
PDF
Time Tracking Features That Teams and Organizations Actually Need
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Tech Workshop Escape Room Tech Workshop
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Trending Python Topics for Data Visualization in 2025
Digital Systems & Binary Numbers (comprehensive )
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
MCP Security Tutorial - Beginner to Advanced
DNT Brochure 2025 – ISV Solutions @ D365
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Custom Software Development Services.pptx.pptx
Salesforce Agentforce AI Implementation.pdf
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
How Tridens DevSecOps Ensures Compliance, Security, and Agility
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
chapter 5 systemdesign2008.pptx for cimputer science students
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
wealthsignaloriginal-com-DS-text-... (1).pdf
STL Containers in C++ : Sequence Container : Vector
Time Tracking Features That Teams and Organizations Actually Need
Why Generative AI is the Future of Content, Code & Creativity?
Tech Workshop Escape Room Tech Workshop

5 Anti-Patterns in API Design - DDD East Anglia 2015