SlideShare a Scribd company logo
@andreasevers	
Netflix OSS and HATEOAS
deployed on production
@andreasevers	
WHOAMI
•  Work for Ordina Belgium
•  Open source enthusiast
•  Spring contributor
•  Speaker
•  Technical lead & coding architect @ Proximus
•  Marathon runner
@andreasevers
@andreasevers	
Benefits
•  Small, easy to understand code base
•  Easy to scale
•  Easy to throw away
•  Easy to deploy
•  Ability to use a different technology stack
•  Smaller teams
•  System resilience
@andreasevers	
Pitfalls
“If you can't build a monolith, what makes you
think microservices are the answer?”
Simon Brown
@andreasevers	
Pitfalls
•  Failing to adopt a contract-first approach
•  Assuming the wrong communication protocol
•  Introducing a shared domain model
•  Defining inappropriate service boundaries
•  Neglecting DevOps and testing concerns
•  Disregarding the human factor
•  Operational complexity not under control
•  Failing to embrace eventual consistency
@andreasevers	
Netflix OSS
@andreasevers	
Gateway
@andreasevers	
Gateway – What’s the use?
@andreasevers	
Gateway
µS µS µS µS µSµS
@andreasevers
@andreasevers
@andreasevers
@andreasevers	
“API Gateways are fast becoming the Enterprise
Service Bus of the microservices era”
Sam Newman
Gateway
@andreasevers	
Service Registry
Service Registry
loyalty
user billing
billing’
loyalty
user user origin
Origin
1
Origin
2billing
loyalty origin
@andreasevers	
Service Registry
Service Registry
loyalty
user billing
billing’
loyalty
user
billing
user origin
Origin
1
Origin
2
loyalty origin
@andreasevers	
billing
Service Registry
Service Registry
loyalty
billing
billing’
loyalty
user user origin
loyalty origin
Origin
1
user
billing’
billing
Origin
2
@andreasevers	
Service Registry
Service Registry
loyalty
user user origin
loyalty origin
Origin
1billing
Origin
2
Service Registry
loyalty
user user origin
loyalty origin
Origin
1billing
Origin
2
loyalty
Cached
Registry
@andreasevers	
Service Registry
@andreasevers
@andreasevers
@andreasevers	
Circuit Breaker
BackendµS
@andreasevers	
Circuit Breaker
BackendµS
@andreasevers	
Circuit Breaker
µS
stream
information
Backend
@andreasevers	
Circuit Breaker - Dashboard
@andreasevers	
Circuit Breaker - Dashboard
@andreasevers	
Config
µS	customer
µS	user
µS	loyalty
Config
Server
@andreasevers	
Metrics & Admin
@andreasevers	
Metrics & Admin
@andreasevers	
Metrics & Admin
@andreasevers	
Metrics & Admin
@andreasevers	
Metrics & Admin
@andreasevers	
Metrics & Admin
@andreasevers	
Metrics & Admin
@andreasevers	
Metrics & Admin
@andreasevers	
Contracts & loose coupling
We can achieve this by using Hypermedia
@andreasevers	
Hypermedia
Hypermedia
As
The
Engine
Of
Application
State
@andreasevers	
Hypermedia
h8ps://vimeo.com/20781278	
Sub-constraints:	
•  IdenDficaDon	of	resources	(URIs)	
•  ManipulaDon	via	representaDons	(request	&	
response	bodies)	
•  Self-descripDve	messages	(headers)	
•  Hypermedia	as	the	engine	of	applicaDon	
state	
HTTP	as	applica+on	protocol
@andreasevers	
Hypermedia
h8ps://vimeo.com/20781278	
Sub-constraints:	
•  IdenDficaDon	of	resources	(URIs)	
•  ManipulaDon	via	representaDons	(request	&	
response	bodies)	
•  Self-descripDve	messages	(headers)	
•  Hypermedia	as	the	engine	of	applicaDon	
state	
If	you	don’t	do	
this	
Then	you	don’t	adhere	to	
this	
And	you	are	missing	out	
on	these
@andreasevers	
Concretely?
@andreasevers	
Hateoas In Action
@andreasevers
@andreasevers
@andreasevers
@andreasevers
@andreasevers
@andreasevers	
Hateoas in action
How would you explain to a client to get to the Nerd in the
Basement painting?
A.  Go to Amazon.com, in the categories go to fine arts, follow
paintings, more specifically oil paintings, and click on the one
with the title Nerd in the Basement
B.  Type
http://www.amazon.com/Nerd-in-the-Basement/dp/
B00L849CSS/ref=lp_6685279011_1_2?
s=art&ie=UTF8&qid=1431864368&sr=1-2 in your browser
@andreasevers	
Hateoas in action
HTML is a hypermedia format
	<a> is a link with method GET
	<form> is a link with method POST (or other if specified)
The browser understands this syntax and shows a link or a form if
the server response contains these tags
@andreasevers	
Hateoas Requirements
Communication between Client and Server depends on:
•  Where does the client have to start?
•  Root API
•  In regular websites: the homepage
•  Where am I?
•  How do I interpret the current API response?
•  In regular websites: the syntax of HTML is interpreted by the browser
•  Where can I go?
•  What does a link or form with a certain relation or class mean?
•  In regular websites: link with relation “stylesheet”, form with action “login”
@andreasevers	
Hateoas in action
Amazon.com (and any other website in the whole world wide web)
applies Hateoas.
Why wouldn’t your API do the same?
@andreasevers	
Hateoas Benefit: Runtime action
discovery
GET /account/12345 HTTP/1.1
HTTP/1.1 200 OK
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<balance currency="usd">100.00</balance>
<link rel="deposit" href="/account/12345/deposit" />
<link rel="withdraw" href="/account/12345/withdraw" />
<link rel="transfer" href="/account/12345/transfer" />
<link rel="close" href="/account/12345/close" />
</account>
@andreasevers	
Hateoas Benefit: Runtime operation
discovery
GET /account/12345 HTTP/1.1
HTTP/1.1 200 OK
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<balance currency="usd">-25.00</balance>
<link rel="deposit" href="/account/12345/
deposit" />
</account>
@andreasevers	
Hateoas Concern: Scope
In case of one or two clients built in the same team, it is arguable
whether auto-discoverability is really a necessity
@andreasevers	
Hateoas Benefit: Non-structural Changes
“categories/1/oil-paintings/1234”
auto-discoverable through HATEOAS as
“categories[1].oil-paintings[1234]”
will not break when 1234 as id is changed to “basementNerd”
@andreasevers	
Hateoas Benefit: Changing the URI of a
resource
“categories/1/oil-paitings/1234”
being returned as part as the response body of
“categories/1”
will not break the client
@andreasevers	
Content Types
•  JSON
•  NOT hypermedia-aware by default
•  Needs a fixed format to support links and forms
•  Many formats available
•  XHTML
•  IS hypermedia-aware by default
•  Harder to process XHTML responses using javascript (xpath is required)
•  The API responses can also be read by a human as regular HTML pages
•  SVG, Atom, HTML
•  Similar as XHTML but not preferred
@andreasevers	
JSON Formats
•  JSON-LD
•  Augmenting existing APIs without introducing breaking changes
•  Needs HYDRA as a vocabulary for communicating operations
•  Decoupling of API serialization format & communication format
•  HAL
•  Minimal, light weight syntax and semantics
•  Offers most of the benefits of using a hypermedia type
•  Easy to convert existing API to HATEOAS
•  Chosen and supported by Spring
•  No support for specifying operations
•  Collection+JSON
•  Can list queries that your collection supports and templates that clients can use to alter your collection
•  Great for publishing user editable data
•  SIREN
•  Represents generic classes of items
•  Supports operations
•  Concept of classes, bringing a sense of type information to your API responses
@andreasevers	
Considerations
Maturity
Client implementation
Caching
Versioning
@andreasevers	
h8ps://speakerdeck.com/ankinson/documenDng-resTul-apis-webinar
@andreasevers	
What should you document
Resources
Links
Cross-cutting concerns
@andreasevers	
What shouldn’t you document
URIs
@andreasevers	
What does it look like when you get it
wrong?
@andreasevers	
What does it look like when you get it
right?
@andreasevers	
Swagger
Doesn’t support Hypermedia
@andreasevers	
Swagger
It’s URI centric
@andreasevers	
Swagger
It’s leaky
@andreasevers	
Swagger
It’s huge
@andreasevers	
Best practices for documentation
Write as much as possible in a format which is designed for writing
Don’t use the implementation to provide the documentation
Provide some guarantees that the documentation is accurate
h8ps://github.com/spring-projects/spring-restdocs
@andreasevers	
Thank you for your attention
@andreasevers
https://github.com/oraj-360
http://registry.oraj360.cfapps.io/
https://netflix.github.io/
http://projects.spring.io/spring-cloud/
http://projects.spring.io/spring-hateoas/
https://github.com/spring-projects/spring-restdocs

More Related Content

PDF
Spring REST Docs: Documenting RESTful APIs using your tests - Devoxx
PPTX
ECS 19 - Chris O'Brien - The hit list - Office 365 dev techniques you should ...
PPTX
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
PDF
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
PPTX
ECS19 - Vesa Juvonen - Getting Started With SharePoint Framework - Roadmap
PDF
[Collinge] Office 365 Enterprise Network Connectivity Using Published Office ...
PPTX
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
PDF
O365con14 - sharepoint online applification
Spring REST Docs: Documenting RESTful APIs using your tests - Devoxx
ECS 19 - Chris O'Brien - The hit list - Office 365 dev techniques you should ...
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
ECS19 - Vesa Juvonen - Getting Started With SharePoint Framework - Roadmap
[Collinge] Office 365 Enterprise Network Connectivity Using Published Office ...
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
O365con14 - sharepoint online applification

What's hot (20)

PPTX
ECS19 - Robi Voncina - Upgrade to SharePoint 2019
PPTX
Developing a Provider Hosted SharePoint app
PDF
REST full API Design
PPTX
[Pinto] Is my SharePoint Development team properly enlighted?
PPTX
SPSNL17 - Getting started with SharePoint development for the reluctant IT Pr...
PPSX
ECS19 - Damir Dobric - Designing and Operating modern applications with Micro...
PPTX
Custom Applications - What, When, and Why
PDF
Getting Started with Oracle APEX
PDF
Database Source Control
PDF
O365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
PPTX
Essential Knowledge for SharePoint Add-Ins
PDF
Spca2014 mirjam van olst upgrading share point 2010 custom solutions to sha...
PPTX
SharePoint for ASP.Net Developers
PPTX
Chris O'Brien - Introduction to the SharePoint Framework for developers
PPTX
SharePoint 2010 - InfoPath, Workflow
PPTX
Salesforce Lightning workshop Hartford - 12 March
PPTX
SPCA2013 - Apps, Apps, Apps
PPTX
Developer’s Independence Day: Introducing the SharePoint App Model
PPTX
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
PPTX
Introduction to the Office Dev PnP Core Libraries
ECS19 - Robi Voncina - Upgrade to SharePoint 2019
Developing a Provider Hosted SharePoint app
REST full API Design
[Pinto] Is my SharePoint Development team properly enlighted?
SPSNL17 - Getting started with SharePoint development for the reluctant IT Pr...
ECS19 - Damir Dobric - Designing and Operating modern applications with Micro...
Custom Applications - What, When, and Why
Getting Started with Oracle APEX
Database Source Control
O365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
Essential Knowledge for SharePoint Add-Ins
Spca2014 mirjam van olst upgrading share point 2010 custom solutions to sha...
SharePoint for ASP.Net Developers
Chris O'Brien - Introduction to the SharePoint Framework for developers
SharePoint 2010 - InfoPath, Workflow
Salesforce Lightning workshop Hartford - 12 March
SPCA2013 - Apps, Apps, Apps
Developer’s Independence Day: Introducing the SharePoint App Model
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Introduction to the Office Dev PnP Core Libraries
Ad

Viewers also liked (8)

PPTX
Gearing up for push notifications
PPTX
HATEOAS - Arquitetura REST 100% aderente
PDF
RESTful HATEOAS standards using Java based Katharsis
PDF
Indexes: The neglected performance all rounder
PDF
Revitalizing Walmart's Aging Architecture for Web Scale
PDF
Pagination Done the Right Way
PDF
REST: From GET to HATEOAS
PPTX
Patterns for building resilient and scalable microservices platform on AWS
Gearing up for push notifications
HATEOAS - Arquitetura REST 100% aderente
RESTful HATEOAS standards using Java based Katharsis
Indexes: The neglected performance all rounder
Revitalizing Walmart's Aging Architecture for Web Scale
Pagination Done the Right Way
REST: From GET to HATEOAS
Patterns for building resilient and scalable microservices platform on AWS
Ad

Similar to Netflix OSS and HATEOAS deployed on production - JavaLand (20)

PDF
Microservices with Netflix OSS & Hypermedia APIs - JavaDay Kiev
PDF
Hypermedia api (HATEOAS)
PPTX
OpenAPI v.Next - Events, Alternative Schemas & the Road Ahead
KEY
I got 99 problems, but ReST ain't one
PDF
API Description Languages
PDF
API Description Languages
PPTX
API workshop: Introduction to APIs (TC Camp)
PDF
A Snapshot of API Design Trends In 2019
PDF
Api design best practice
PDF
Facebook & Twitter API
PPTX
Scaling with swagger
PPTX
RESTful Services
PPTX
Making Sense of Hypermedia APIs – Hype or Reality?
PPTX
Rest APIs Training
PDF
Api craft notes
PPTX
Phalcon 2 High Performance APIs - DevWeekPOA 2015
PPTX
Hypermedia API and how to document it effectively
PDF
Consumer centric api design v0.4.0
PDF
PDF
Past, Present and Future of APIs of Mobile and Web Apps
Microservices with Netflix OSS & Hypermedia APIs - JavaDay Kiev
Hypermedia api (HATEOAS)
OpenAPI v.Next - Events, Alternative Schemas & the Road Ahead
I got 99 problems, but ReST ain't one
API Description Languages
API Description Languages
API workshop: Introduction to APIs (TC Camp)
A Snapshot of API Design Trends In 2019
Api design best practice
Facebook & Twitter API
Scaling with swagger
RESTful Services
Making Sense of Hypermedia APIs – Hype or Reality?
Rest APIs Training
Api craft notes
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Hypermedia API and how to document it effectively
Consumer centric api design v0.4.0
Past, Present and Future of APIs of Mobile and Web Apps

More from JWORKS powered by Ordina (20)

PDF
Introduction to Webpack - Ordina JWorks - CC JS & Web
PDF
Lagom in Practice
PDF
Cc internet of things @ Thomas More
PDF
Introduction to Docker
PDF
An introduction to Cloud Foundry
PDF
Cc internet of things LoRa and IoT - Innovation Enablers
PPTX
PPTX
Mongo db intro.pptx
PPTX
Big data document and graph d bs - couch-db and orientdb
PPTX
Big data key-value and column stores redis - cassandra
PPTX
Hadoop bootcamp getting started
PPTX
Big data elasticsearch practical
PDF
Intro to cassandra
PPTX
Android wear - CC Mobile
PPTX
Clean Code - A&BP CC
PDF
Unit testing - A&BP CC
PDF
Integration testing - A&BP CC
PDF
Documenting your REST API with Swagger - JOIN 2014
PDF
Spring 4 - A&BP CC
PPTX
Android secure offline storage - CC Mobile
Introduction to Webpack - Ordina JWorks - CC JS & Web
Lagom in Practice
Cc internet of things @ Thomas More
Introduction to Docker
An introduction to Cloud Foundry
Cc internet of things LoRa and IoT - Innovation Enablers
Mongo db intro.pptx
Big data document and graph d bs - couch-db and orientdb
Big data key-value and column stores redis - cassandra
Hadoop bootcamp getting started
Big data elasticsearch practical
Intro to cassandra
Android wear - CC Mobile
Clean Code - A&BP CC
Unit testing - A&BP CC
Integration testing - A&BP CC
Documenting your REST API with Swagger - JOIN 2014
Spring 4 - A&BP CC
Android secure offline storage - CC Mobile

Recently uploaded (20)

PDF
Well-logging-methods_new................
PDF
PPT on Performance Review to get promotions
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
web development for engineering and engineering
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
DOCX
573137875-Attendance-Management-System-original
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
additive manufacturing of ss316l using mig welding
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Well-logging-methods_new................
PPT on Performance Review to get promotions
UNIT 4 Total Quality Management .pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
web development for engineering and engineering
Arduino robotics embedded978-1-4302-3184-4.pdf
bas. eng. economics group 4 presentation 1.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CH1 Production IntroductoryConcepts.pptx
Sustainable Sites - Green Building Construction
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
573137875-Attendance-Management-System-original
Embodied AI: Ushering in the Next Era of Intelligent Systems
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
OOP with Java - Java Introduction (Basics)
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
additive manufacturing of ss316l using mig welding
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx

Netflix OSS and HATEOAS deployed on production - JavaLand