SlideShare une entreprise Scribd logo
1  sur  34
RestFest 2017
orubel@gmail.comOwen Rubel
The New API Pattern
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
First Lets Understand The Difference Between
Centralized and Distributed Architectures…
Understanding The API Pattern
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Centralized vs Distributed Architecture
Centralized Architecture (Unshared I/O)
Distributed Architecture (Shared I/O)
microservices
monolith application
monolith application
proxy MQapp
server
Client Client
ClientClient
(CORS,security) (caching,security)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• How many developers still use a centralized architecture vs a
distributed architecture in their development?
Centralized vs Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• How many developers still use a centralized architecture vs a
distributed architecture in their development?
• How many developers used a centralized architecture for their
development 5 years ago? 10 years ago?
Centralized vs Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• How many developers still use a centralized architecture vs a
distributed architecture in their development?
• How many developers used a centralized architecture for their
development 5 years ago? 10 years ago?
• Over the last 20+ years, there has been a trend toward distributed
architectures due to separation of services/concerns, micro
services, and Aspect Oriented Programming
Centralized vs Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
“ An API is Standardized Input/Output (I/O) to/from
a Separation of Concern (usually being Business
Logic).”
In Short :
What Is An API? (1 OF 2)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Is An API? (2 OF 2)
owenr@uw.edu
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
“ In computer science, separation of concerns (SoC) is a
design principle for separating a computer program
into distinct sections, such that each section addresses
a separate concern. A concern is a set of information that
affects the code of a computer program” (ex HTML, CSS,
JS)
- Source : Separation Of Concern, Wikipedia
What Is Separation of Concern? (1 of 2)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Is Separation of Concern? (2 of 2)
Bound Secondary
Concern
(Communication
Logic)
Primary
Concern
(Business Logic)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
API Pattern in Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
API Pattern in Distributed Architecture
Bound I/O Data
and/or Functionality
DUPLICATED I/O Data DUPLICATED I/O Data
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
API Pattern in Distributed Architecture
Cross Cutting Concern
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
“Cross-cutting concerns can be directly responsible for tangling,
or system inter-dependencies, within a program. Because
procedural and functional language constructs consist entirely of
procedure calling, there is no semantic through where two
goals (the capability to be implemented and the related cross-
cutting concern) can be addressed simultaneously.[3] As a
result, the code addressing the cross-cutting concern must be
scattered, or duplicated, across the various related locations,
resulting in a loss of modularity.[2]”
- Source : Cross Cutting Concern, Wikipedia
What is a Cross Cutting Concern?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Synchronization
• Real-time constraints
• Error detection and correction
• Product features
• Memory management
• Data validation
• Persistence
• Transaction processing
• Internationalization and localization which includes
Language localisation
• Information security
• Caching
• Logging
• Monitoring
• Business rules
• Code mobility
• Domain-specific optimizations
Issues of a Cross Cutting Concern
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
This is The API Patterns Brick Wall
Brick Wall
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• API’s were created in 70’s to standardize information
exchanged between services
• 70’s api pattern was designed for centralized
architecture; distributed architectures didn't exist.
• Web API’s were based on 70’s api pattern; Roy Fielding
based his work on this pre-existing pattern.
• Web API’s were integrated into MVC frameworks and
tools; it is now used everywhere.
• JAX-RS and other tools were based on old patterns as
they bind to business logic
Why Did This Happen? (1 of 2)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Distributed Architectures are a New Pattern. Old principles
and patterns are often not re-examined unless an issue is
discovered. In the case of API’s, they are a tried and true
pattern and still work locally… but not ‘distributed’
• People ASSUMED the resource was the endpoint; The
controller hands the resource OFF to the communication layer.
The communication layer hands off I/O to other services in a
distributed architecture. Hence, the communication layer is the
endpoint.
Why Did This Happen? (2 of 2)
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
So How Do We Fix?
Title Text
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Old API Pattern in MVC
redirect/response
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
New API Pattern in MVC
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
New API Pattern In Distributed Architecture
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
This allows:
• Central Piece of architecture (where REQUEST AND RESPONSE
are handled) to be ‘Single Version of Truth’ (SOV) called ‘IO State’
• All services to sync data from SOV
• Failure of SOV DOES NOT affect synchronization of data
• Reload state on the fly at SOV and update ALL subscribed services
Shared IO State
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
So What Is IO State?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What is IO State?
• Caches Communications Data
• Synchronizes Architectural Props (distribute rules of communication)
• Handles API Authorizations (access for communication)
• Api Docs Definitions (how to communicate)
I/O State is data directly related to a request/response, normally
separated from functionality. Handles all data associated with
communication and communication access
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Does IO State Contain
•all the data contained in annotations act as rules associated with the
URI endpoint (not URL or the FQDN)
•by containing all those rules in one file and caching that data, we can
share it with the other architectural components (and abstract data from
functionality)
•this enables us to change it on the fly and reload without having to
restart any services allowing subscribed services to get changes
pushed to them through web hooks
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
I/O State : Communications Properties
Shared I/O State is ‘IO State’ data unbound from
functionality so that it can be shared across architectural
components. This is the approach used by distributed
architectures.
Bound I/O State is ‘I/O State’ data bound to functionality
which cannot be shared or synchronized with additional
architectural components creating an ‘architectural cross
cutting concern’. This is commonly found in centralized
architectures.
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Shared I/O State
• DOESN’T bind to the application
• DOESN’T bind to functionality
• DOESN’T bind to a resource
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
What Does It Look Like?
Title Text
https://gist.github.com/orubel/7c4d0290c7b8896667a3
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Api Blueprint, Swagger, RAML
• not role based
• confuses I/O state with content/resource
• based on annotations and thus not sharable in distributed architecture
• duplicitous; lack of separation
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
• Dramatic Code reduction By Reducing Duplication
• Automation of nearly all aspects of API
• Nearly 0% downtime for changes to endpoint data and rules
• New API Patterns (ie API Chaining (tm) )
What Does It Improve?
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Code Reduction (1 of 2)
Controller : Mixed Concerns (Duplication)
@Secured(['ROLE_ADMIN', ‘ROLE_USER'])
@RequestMapping(value="/create", method=RequestMethod.POST)
@ResponseBody
public ModelAndView createAddress(){
List authorities = springSecurityService.getPrincipal().getAuthorities()
User user
if(authorities.contains(‘ROLE_ADMIN’)){
if(params.id){
user = User.get(params.id.toLong())
}else{
render(status:HttpServletResponse.SC_BAD_REQUEST)
}
}else if(authorities.contains(‘ROLE_USER’)){
user = User.get(principal.id)
}
Address address = new Address(params)
…
address.user = user
…
Title Text
RestFest 2017
orubel@gmail.comOwen Rubel
Code Reduction (2 of 2)
Controller : Single Concern
public ModelAndView createAddress(){
User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id)
Address address = new Address(params)
address.user = user
…
}
RestFest 2017
orubel@gmail.comOwen Rubel
Questions?
(please contact for business opportunities or hiring)
Just Open Sourced At RestFest
• https://github.com/orubel/beapi_backend

Contenu connexe

Tendances

Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Kai Wähner
 
What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...Edureka!
 
We Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge ArchitectureWe Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge ArchitectureApigee | Google Cloud
 
Mapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slidesMapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slidesApigee | Google Cloud
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 
Building an API Security Strategy
Building an API Security StrategyBuilding an API Security Strategy
Building an API Security StrategySmartBear
 
API Management in Digital Transformation
API Management in Digital TransformationAPI Management in Digital Transformation
API Management in Digital TransformationAditya Thatte
 
Spring cloud for microservices architecture
Spring cloud for microservices architectureSpring cloud for microservices architecture
Spring cloud for microservices architectureIgor Khotin
 
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at NetflixConfiguration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at NetflixJustin Ryan
 
Designing APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven DesignDesigning APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven DesignLaunchAny
 
From capabilities to services modelling for business-it alignment v.2
From capabilities to services   modelling for business-it alignment v.2From capabilities to services   modelling for business-it alignment v.2
From capabilities to services modelling for business-it alignment v.2Trond Hjorteland
 
Why API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsWhy API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsJohn Musser
 
API Strategy Evolution at Netflix
API Strategy Evolution at NetflixAPI Strategy Evolution at Netflix
API Strategy Evolution at NetflixMichael Hart
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitecturePaul Mooney
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice ArchitectureNguyen Tung
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices Amazon Web Services
 

Tendances (20)

Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...What are Microservices | Microservices Architecture Training | Microservices ...
What are Microservices | Microservices Architecture Training | Microservices ...
 
We Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge ArchitectureWe Built This City - Apigee Edge Architecture
We Built This City - Apigee Edge Architecture
 
Mapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slidesMapping out your API Strategy - 4.20.11 Webinar slides
Mapping out your API Strategy - 4.20.11 Webinar slides
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
Building an API Security Strategy
Building an API Security StrategyBuilding an API Security Strategy
Building an API Security Strategy
 
API Management in Digital Transformation
API Management in Digital TransformationAPI Management in Digital Transformation
API Management in Digital Transformation
 
Spring cloud for microservices architecture
Spring cloud for microservices architectureSpring cloud for microservices architecture
Spring cloud for microservices architecture
 
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at NetflixConfiguration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
 
Designing APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven DesignDesigning APIs and Microservices Using Domain-Driven Design
Designing APIs and Microservices Using Domain-Driven Design
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
From capabilities to services modelling for business-it alignment v.2
From capabilities to services   modelling for business-it alignment v.2From capabilities to services   modelling for business-it alignment v.2
From capabilities to services modelling for business-it alignment v.2
 
Why API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOpsWhy API Ops is the Next Wave of DevOps
Why API Ops is the Next Wave of DevOps
 
API Strategy Evolution at Netflix
API Strategy Evolution at NetflixAPI Strategy Evolution at Netflix
API Strategy Evolution at Netflix
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Apigee Products Overview
Apigee Products OverviewApigee Products Overview
Apigee Products Overview
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 

Similaire à The New API Pattern for Distributed Architectures

Yuriy Chapran - Building microservices.
Yuriy Chapran - Building microservices.Yuriy Chapran - Building microservices.
Yuriy Chapran - Building microservices.Yuriy Chapran
 
Dynamic APIs: SOA Done Right
Dynamic APIs: SOA Done RightDynamic APIs: SOA Done Right
Dynamic APIs: SOA Done RightInside Analysis
 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCapgemini
 
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...marksimpsongw
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionGlenn Antoine
 
The LINQ Between XML and Database
The LINQ Between XML and DatabaseThe LINQ Between XML and Database
The LINQ Between XML and DatabaseIRJET Journal
 
SOA (Service Oriented Architecture)
SOA (Service Oriented Architecture)SOA (Service Oriented Architecture)
SOA (Service Oriented Architecture)Annie Comp
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design PatternsHaim Michael
 
WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...
WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...
WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...WSO2
 
apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...
apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...
apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...apidays
 
J2EE Performance And Scalability Bp
J2EE Performance And Scalability BpJ2EE Performance And Scalability Bp
J2EE Performance And Scalability BpChris Adkin
 
DDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichDDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichIvan Paulovich
 
MuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration ArchitectureMuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration ArchitectureKim Clark
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachBen Stopford
 
How to Migrate Applications Off a Mainframe
How to Migrate Applications Off a MainframeHow to Migrate Applications Off a Mainframe
How to Migrate Applications Off a MainframeVMware Tanzu
 
SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...
SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...
SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...ijwscjournal
 

Similaire à The New API Pattern for Distributed Architectures (20)

Apiworld
ApiworldApiworld
Apiworld
 
Yuriy Chapran - Building microservices.
Yuriy Chapran - Building microservices.Yuriy Chapran - Building microservices.
Yuriy Chapran - Building microservices.
 
Dynamic APIs: SOA Done Right
Dynamic APIs: SOA Done RightDynamic APIs: SOA Done Right
Dynamic APIs: SOA Done Right
 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der wal
 
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
Mark Simpson - UKOUG23 - Refactoring Monolithic Oracle Database Applications ...
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of Confusion
 
The LINQ Between XML and Database
The LINQ Between XML and DatabaseThe LINQ Between XML and Database
The LINQ Between XML and Database
 
SOA (Service Oriented Architecture)
SOA (Service Oriented Architecture)SOA (Service Oriented Architecture)
SOA (Service Oriented Architecture)
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
 
WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...
WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...
WSO2 Guest Webinar - ESB meets IoT, a Primer on WSO2 Enterprise Service Bus (...
 
ShreoshiRaha_CV
ShreoshiRaha_CVShreoshiRaha_CV
ShreoshiRaha_CV
 
apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...
apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...
apidays LIVE Paris 2021 - APIs - How did we get here and where are we going n...
 
Architecting for Scale
Architecting for ScaleArchitecting for Scale
Architecting for Scale
 
J2EE Performance And Scalability Bp
J2EE Performance And Scalability BpJ2EE Performance And Scalability Bp
J2EE Performance And Scalability Bp
 
DDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichDDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan Paulovich
 
MuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration ArchitectureMuCon 2015 - Microservices in Integration Architecture
MuCon 2015 - Microservices in Integration Architecture
 
L02 Architecture
L02 ArchitectureL02 Architecture
L02 Architecture
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
 
How to Migrate Applications Off a Mainframe
How to Migrate Applications Off a MainframeHow to Migrate Applications Off a Mainframe
How to Migrate Applications Off a Mainframe
 
SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...
SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...
SOME INTEROPERABILITY ISSUES IN THE DESIGNING OF WEB SERVICES : CASE STUDY ON...
 

Dernier

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Dernier (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

The New API Pattern for Distributed Architectures

  • 2. Title Text RestFest 2017 orubel@gmail.comOwen Rubel First Lets Understand The Difference Between Centralized and Distributed Architectures… Understanding The API Pattern
  • 3. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Centralized vs Distributed Architecture Centralized Architecture (Unshared I/O) Distributed Architecture (Shared I/O) microservices monolith application monolith application proxy MQapp server Client Client ClientClient (CORS,security) (caching,security)
  • 4. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • How many developers still use a centralized architecture vs a distributed architecture in their development? Centralized vs Distributed Architecture
  • 5. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • How many developers still use a centralized architecture vs a distributed architecture in their development? • How many developers used a centralized architecture for their development 5 years ago? 10 years ago? Centralized vs Distributed Architecture
  • 6. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • How many developers still use a centralized architecture vs a distributed architecture in their development? • How many developers used a centralized architecture for their development 5 years ago? 10 years ago? • Over the last 20+ years, there has been a trend toward distributed architectures due to separation of services/concerns, micro services, and Aspect Oriented Programming Centralized vs Distributed Architecture
  • 7. Title Text RestFest 2017 orubel@gmail.comOwen Rubel “ An API is Standardized Input/Output (I/O) to/from a Separation of Concern (usually being Business Logic).” In Short : What Is An API? (1 OF 2)
  • 8. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Is An API? (2 OF 2) owenr@uw.edu
  • 9. Title Text RestFest 2017 orubel@gmail.comOwen Rubel “ In computer science, separation of concerns (SoC) is a design principle for separating a computer program into distinct sections, such that each section addresses a separate concern. A concern is a set of information that affects the code of a computer program” (ex HTML, CSS, JS) - Source : Separation Of Concern, Wikipedia What Is Separation of Concern? (1 of 2)
  • 10. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Is Separation of Concern? (2 of 2) Bound Secondary Concern (Communication Logic) Primary Concern (Business Logic)
  • 11. Title Text RestFest 2017 orubel@gmail.comOwen Rubel API Pattern in Distributed Architecture
  • 12. Title Text RestFest 2017 orubel@gmail.comOwen Rubel API Pattern in Distributed Architecture Bound I/O Data and/or Functionality DUPLICATED I/O Data DUPLICATED I/O Data
  • 13. Title Text RestFest 2017 orubel@gmail.comOwen Rubel API Pattern in Distributed Architecture Cross Cutting Concern
  • 14. Title Text RestFest 2017 orubel@gmail.comOwen Rubel “Cross-cutting concerns can be directly responsible for tangling, or system inter-dependencies, within a program. Because procedural and functional language constructs consist entirely of procedure calling, there is no semantic through where two goals (the capability to be implemented and the related cross- cutting concern) can be addressed simultaneously.[3] As a result, the code addressing the cross-cutting concern must be scattered, or duplicated, across the various related locations, resulting in a loss of modularity.[2]” - Source : Cross Cutting Concern, Wikipedia What is a Cross Cutting Concern?
  • 15. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Synchronization • Real-time constraints • Error detection and correction • Product features • Memory management • Data validation • Persistence • Transaction processing • Internationalization and localization which includes Language localisation • Information security • Caching • Logging • Monitoring • Business rules • Code mobility • Domain-specific optimizations Issues of a Cross Cutting Concern
  • 16. Title Text RestFest 2017 orubel@gmail.comOwen Rubel This is The API Patterns Brick Wall Brick Wall
  • 17. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • API’s were created in 70’s to standardize information exchanged between services • 70’s api pattern was designed for centralized architecture; distributed architectures didn't exist. • Web API’s were based on 70’s api pattern; Roy Fielding based his work on this pre-existing pattern. • Web API’s were integrated into MVC frameworks and tools; it is now used everywhere. • JAX-RS and other tools were based on old patterns as they bind to business logic Why Did This Happen? (1 of 2)
  • 18. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Distributed Architectures are a New Pattern. Old principles and patterns are often not re-examined unless an issue is discovered. In the case of API’s, they are a tried and true pattern and still work locally… but not ‘distributed’ • People ASSUMED the resource was the endpoint; The controller hands the resource OFF to the communication layer. The communication layer hands off I/O to other services in a distributed architecture. Hence, the communication layer is the endpoint. Why Did This Happen? (2 of 2)
  • 19. Title Text RestFest 2017 orubel@gmail.comOwen Rubel So How Do We Fix? Title Text
  • 20. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Old API Pattern in MVC redirect/response
  • 21. Title Text RestFest 2017 orubel@gmail.comOwen Rubel New API Pattern in MVC
  • 22. Title Text RestFest 2017 orubel@gmail.comOwen Rubel New API Pattern In Distributed Architecture
  • 23. Title Text RestFest 2017 orubel@gmail.comOwen Rubel This allows: • Central Piece of architecture (where REQUEST AND RESPONSE are handled) to be ‘Single Version of Truth’ (SOV) called ‘IO State’ • All services to sync data from SOV • Failure of SOV DOES NOT affect synchronization of data • Reload state on the fly at SOV and update ALL subscribed services Shared IO State
  • 24. Title Text RestFest 2017 orubel@gmail.comOwen Rubel So What Is IO State?
  • 25. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What is IO State? • Caches Communications Data • Synchronizes Architectural Props (distribute rules of communication) • Handles API Authorizations (access for communication) • Api Docs Definitions (how to communicate) I/O State is data directly related to a request/response, normally separated from functionality. Handles all data associated with communication and communication access
  • 26. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Does IO State Contain •all the data contained in annotations act as rules associated with the URI endpoint (not URL or the FQDN) •by containing all those rules in one file and caching that data, we can share it with the other architectural components (and abstract data from functionality) •this enables us to change it on the fly and reload without having to restart any services allowing subscribed services to get changes pushed to them through web hooks
  • 27. Title Text RestFest 2017 orubel@gmail.comOwen Rubel I/O State : Communications Properties Shared I/O State is ‘IO State’ data unbound from functionality so that it can be shared across architectural components. This is the approach used by distributed architectures. Bound I/O State is ‘I/O State’ data bound to functionality which cannot be shared or synchronized with additional architectural components creating an ‘architectural cross cutting concern’. This is commonly found in centralized architectures.
  • 28. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Shared I/O State • DOESN’T bind to the application • DOESN’T bind to functionality • DOESN’T bind to a resource
  • 29. Title Text RestFest 2017 orubel@gmail.comOwen Rubel What Does It Look Like? Title Text https://gist.github.com/orubel/7c4d0290c7b8896667a3
  • 30. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Api Blueprint, Swagger, RAML • not role based • confuses I/O state with content/resource • based on annotations and thus not sharable in distributed architecture • duplicitous; lack of separation
  • 31. Title Text RestFest 2017 orubel@gmail.comOwen Rubel • Dramatic Code reduction By Reducing Duplication • Automation of nearly all aspects of API • Nearly 0% downtime for changes to endpoint data and rules • New API Patterns (ie API Chaining (tm) ) What Does It Improve?
  • 32. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Code Reduction (1 of 2) Controller : Mixed Concerns (Duplication) @Secured(['ROLE_ADMIN', ‘ROLE_USER']) @RequestMapping(value="/create", method=RequestMethod.POST) @ResponseBody public ModelAndView createAddress(){ List authorities = springSecurityService.getPrincipal().getAuthorities() User user if(authorities.contains(‘ROLE_ADMIN’)){ if(params.id){ user = User.get(params.id.toLong()) }else{ render(status:HttpServletResponse.SC_BAD_REQUEST) } }else if(authorities.contains(‘ROLE_USER’)){ user = User.get(principal.id) } Address address = new Address(params) … address.user = user …
  • 33. Title Text RestFest 2017 orubel@gmail.comOwen Rubel Code Reduction (2 of 2) Controller : Single Concern public ModelAndView createAddress(){ User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id) Address address = new Address(params) address.user = user … }
  • 34. RestFest 2017 orubel@gmail.comOwen Rubel Questions? (please contact for business opportunities or hiring) Just Open Sourced At RestFest • https://github.com/orubel/beapi_backend