LOW-CODE API
APIS THAT DON'T BREAK
SUPERFACE.AI
Core member of Apiary


API startup, acquired by Oracle in 2016


Founder of API consulting agency Good API


Helps several Fortune 100 companies with their API strategy
and execution


Founder & CTO of superface.ai
Zdenek “Z” Nemec
SUPERFACE.AI
Change is a constant, APIs break
SUPERFACE.AI
backend@mycompany.com
API versioning comes after a breaking change
SUPERFACE.AI
this talk is not about API versioning
Why APIs break?
SUPERFACE.AI
Why APIs break?
SUPERFACE.AI
Business
capabilities
Technical


interfaces
APIs
APIs are where business capabilities meet technical interfaces
Why APIs break?
SUPERFACE.AI
Business reasons Technical reasons
Why APIs break?
SUPERFACE.AI
Business reasons
Technical reasons
• Business strategy


• Business availability


• Business rules change


• Regulations
Why APIs break?
SUPERFACE.AI
Business reasons
Technical reasons
• Business strategy


• Business availability


• Business rules change


• Regulations
• API design change


• Optimization


• Deprecation


• Leaking internal changes


• Bugs, regression issues


• Documentation out of sync


• Network issues


• OPS issues
What can we do
SUPERFACE.AI
Technical
reasons
to prevent APIs from breaking
Decouple client from server
SUPERFACE.AI
tight coupling
• more interdependency


• more coordination


• higher information density
loose coupling
• less interdependency


• less coordination


• lower information density
Technical
reasons
Image credits: https://en.wikipedia.org/wiki/
Coupling_(computer_programming)
Decouple client from server
SUPERFACE.AI
Server-side Client-side
Server-side Client-side
Technical
reasons
What (else) can we do?
SUPERFACE.AI
• Decouple clients


→ describe your capabilities not
API


• Minimize the need for change


• Don’t do breaking changes
• Decouple from server


→ program for capability not API


• Minimize the need for change


• Play defensive


• Have backup-plan: API
consumption strategy
Server-side Client-side
Technical
reasons
How
SUPERFACE.AI
Technical
reasons
to prevent APIs from breaking
Decouple client and server
Server-side
Client-side
reduce the touch point between client and server to business logic
Business use-case Technicalities how to call API
Design-time

(programming the client)
Runtime

(running the client)
SUPERFACE.AI
Showcasing solution with superface.ai, other decoupling solutions possible
e.g. using ALPS or hypermedia + vocabularies
Decouple client and server
Server-side
Client-side
program client for use-case NOT API
SUPERFACE.AI
NOTHING about API
in client codebase
Decouple client and server
Actual API Call
Code executed
API
Runtime: Instructions how to make API Call
Server-side
Client-side
Comlink
Technicalities how to call API
Business use-case
ONE
Universal API client
the whole picture
SUPERFACE.AI
TL;DR: Decouple client and server
Describe your capabilities, not APIs Program for capability, not API
Provider Consumer
SUPERFACE.AI
SUPERFACE.AI
• Use clean, hexagonal architecture


• Representor pattern


• Do not leak internal systems /
implementation to the API surface
(design)


• Do not depend on API surface in the
client business logic
Minimize the need for change
https://medium.com/idealo-tech-blog/hexagonal-ports-adapters-architecture-e3617bcf00a0
Server-side
Client-side
SUPERFACE.AI
1. You MUST NOT take anything away


2. You MUST NOT change processing rules


3. You MUST NOT make optional things required


4. Anything you add MUST be optional
No breaking changes
Rules for extending
Server-side
follow rules for extending
For breaking changes follow selected API versioning strategy or API change
management
Defensive client, tolerant reader
Be conservative in what you do, be liberal in what you
accept from others.




– Jon Postel
https://martinfowler.com/bliki/TolerantReader.html
Client-side
SUPERFACE.AI
Have backup-plan: API consumption strategy
• Know your dependencies


• Monitor your dependencies


• Have retry policies in place


• Redundancy: fail-over
Client-side
SUPERFACE.AI
Outcome
SUPERFACE.AI
Low-code: No API code in client
Client-side
SUPERFACE.AI
ONE PER PROVIDER


API–speci
fi
c code
ONE PER USE-CASE


Business-speci
fi
c code
-vs-
❌ BRITTLE INTEGRATION
breaks if API changes, results in vendor lock-in
🟢 RESILIENT TO CHANGES
redundancy, provider selection freedom
Low-code: No versions in codebase
SUPERFACE.AI
Server-side
ONE VERSION


Evolve independently, do
not drag the legacy along
EVERY VERSION OF API


Version -speci
fi
c code,
deployments, monitoring,
support, documentation...
-vs-
Outcome
SUPERFACE.AI
• Dramatic Code base reduction → min time to market, costs


• Highly resilient API clients → min downtime, maintenance


• Redundancy → backup providers, opening competition


• Documentation reduction → min time, min room for error, costs
SUPERFACE.AI
LET’S GET IN TOUCH


I’d like to know what you think!


SUPERFACE.AI


Technical preview available today
@ZDNE


Z@SUPERFACE.AI
TWITTER


EMAIL
THANK YOU!

INTERFACE, by apidays - Low code APIs that don't break by Zdenek Nemec, Superface.ai

  • 1.
    LOW-CODE API APIS THATDON'T BREAK SUPERFACE.AI
  • 2.
    Core member ofApiary API startup, acquired by Oracle in 2016 
 Founder of API consulting agency Good API Helps several Fortune 100 companies with their API strategy and execution 
 Founder & CTO of superface.ai Zdenek “Z” Nemec SUPERFACE.AI
  • 3.
    Change is aconstant, APIs break SUPERFACE.AI
  • 6.
  • 7.
    API versioning comesafter a breaking change SUPERFACE.AI this talk is not about API versioning
  • 8.
  • 9.
    Why APIs break? SUPERFACE.AI Business capabilities Technical 
 interfaces APIs APIsare where business capabilities meet technical interfaces
  • 10.
    Why APIs break? SUPERFACE.AI Businessreasons Technical reasons
  • 11.
    Why APIs break? SUPERFACE.AI Businessreasons Technical reasons • Business strategy • Business availability • Business rules change • Regulations
  • 12.
    Why APIs break? SUPERFACE.AI Businessreasons Technical reasons • Business strategy • Business availability • Business rules change • Regulations • API design change • Optimization • Deprecation • Leaking internal changes • Bugs, regression issues • Documentation out of sync • Network issues • OPS issues
  • 13.
    What can wedo SUPERFACE.AI Technical reasons to prevent APIs from breaking
  • 14.
    Decouple client fromserver SUPERFACE.AI tight coupling • more interdependency • more coordination • higher information density loose coupling • less interdependency • less coordination • lower information density Technical reasons Image credits: https://en.wikipedia.org/wiki/ Coupling_(computer_programming)
  • 15.
    Decouple client fromserver SUPERFACE.AI Server-side Client-side Server-side Client-side Technical reasons
  • 16.
    What (else) canwe do? SUPERFACE.AI • Decouple clients 
 → describe your capabilities not API • Minimize the need for change • Don’t do breaking changes • Decouple from server 
 → program for capability not API • Minimize the need for change • Play defensive • Have backup-plan: API consumption strategy Server-side Client-side Technical reasons
  • 17.
  • 18.
    Decouple client andserver Server-side Client-side reduce the touch point between client and server to business logic Business use-case Technicalities how to call API Design-time (programming the client) Runtime (running the client) SUPERFACE.AI Showcasing solution with superface.ai, other decoupling solutions possible e.g. using ALPS or hypermedia + vocabularies
  • 19.
    Decouple client andserver Server-side Client-side program client for use-case NOT API SUPERFACE.AI NOTHING about API in client codebase
  • 20.
    Decouple client andserver Actual API Call Code executed API Runtime: Instructions how to make API Call Server-side Client-side Comlink Technicalities how to call API Business use-case ONE Universal API client the whole picture SUPERFACE.AI
  • 21.
    TL;DR: Decouple clientand server Describe your capabilities, not APIs Program for capability, not API Provider Consumer SUPERFACE.AI
  • 22.
    SUPERFACE.AI • Use clean,hexagonal architecture • Representor pattern • Do not leak internal systems / implementation to the API surface (design) • Do not depend on API surface in the client business logic Minimize the need for change https://medium.com/idealo-tech-blog/hexagonal-ports-adapters-architecture-e3617bcf00a0 Server-side Client-side
  • 23.
    SUPERFACE.AI 1. You MUSTNOT take anything away 2. You MUST NOT change processing rules 3. You MUST NOT make optional things required 4. Anything you add MUST be optional No breaking changes Rules for extending Server-side follow rules for extending For breaking changes follow selected API versioning strategy or API change management
  • 24.
    Defensive client, tolerantreader Be conservative in what you do, be liberal in what you accept from others. 
 
 – Jon Postel https://martinfowler.com/bliki/TolerantReader.html Client-side SUPERFACE.AI
  • 25.
    Have backup-plan: APIconsumption strategy • Know your dependencies • Monitor your dependencies • Have retry policies in place • Redundancy: fail-over Client-side SUPERFACE.AI
  • 26.
  • 27.
    Low-code: No APIcode in client Client-side SUPERFACE.AI ONE PER PROVIDER 
 API–speci fi c code ONE PER USE-CASE 
 Business-speci fi c code -vs- ❌ BRITTLE INTEGRATION breaks if API changes, results in vendor lock-in 🟢 RESILIENT TO CHANGES redundancy, provider selection freedom
  • 28.
    Low-code: No versionsin codebase SUPERFACE.AI Server-side ONE VERSION 
 Evolve independently, do not drag the legacy along EVERY VERSION OF API 
 Version -speci fi c code, deployments, monitoring, support, documentation... -vs-
  • 29.
    Outcome SUPERFACE.AI • Dramatic Codebase reduction → min time to market, costs • Highly resilient API clients → min downtime, maintenance • Redundancy → backup providers, opening competition • Documentation reduction → min time, min room for error, costs
  • 30.
    SUPERFACE.AI LET’S GET INTOUCH I’d like to know what you think! SUPERFACE.AI Technical preview available today @ZDNE 
 Z@SUPERFACE.AI TWITTER 
 EMAIL THANK YOU!