SlideShare a Scribd company logo
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

More Related Content

What's hot

API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
Prakash Bhandari
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
Ashok Pundit
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
Mule expression language
Mule expression languageMule expression language
Mule expression language
sathyaraj Anand
 
API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
Patrick Savalle
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
Tricode (part of Dept)
 
Api types
Api typesApi types
Api types
Sarah Maddox
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
Binu Bhasuran
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
SmartBear
 
Rest API
Rest APIRest API
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1
SmartBear
 
React Hooks
React HooksReact Hooks
React Hooks
Joao Marins
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
Tessa Mero
 
API Strategy Presentation
API Strategy PresentationAPI Strategy Presentation
API Strategy Presentation
Lawrence Coburn
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
Amazon Web Services
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Amazon Web Services
 
DevOps with Chef
DevOps with ChefDevOps with Chef
DevOps with Chef
Kellton Tech Solutions Ltd
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performance
supergigas
 

What's hot (20)

API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Mule expression language
Mule expression languageMule expression language
Mule expression language
 
API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Api types
Api typesApi types
Api types
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
 
Rest API
Rest APIRest API
Rest API
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1
 
React Hooks
React HooksReact Hooks
React Hooks
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
API Strategy Presentation
API Strategy PresentationAPI Strategy Presentation
API Strategy Presentation
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
DevOps with Chef
DevOps with ChefDevOps with Chef
DevOps with Chef
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performance
 

Similar to Api pattern

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 Right
Inside 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 wal
Capgemini
 
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 Confusion
Glenn Antoine
 
The LINQ Between XML and Database
The LINQ Between XML and DatabaseThe LINQ Between XML and Database
The LINQ Between XML and Database
IRJET 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 Patterns
Haim 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
 
ShreoshiRaha_CV
ShreoshiRaha_CVShreoshiRaha_CV
ShreoshiRaha_CV
Shreoshi Raha
 
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
 
Architecting for Scale
Architecting for ScaleArchitecting for Scale
Architecting for Scale
Pooyan Jamshidi
 
J2EE Performance And Scalability Bp
J2EE Performance And Scalability BpJ2EE Performance And Scalability Bp
J2EE Performance And Scalability Bp
Chris 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 Paulovich
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
Kim Clark
 
L02 Architecture
L02 ArchitectureL02 Architecture
L02 Architecture
Ólafur Andri Ragnarsson
 
Architecting for Change: An Agile Approach
Architecting for Change: An Agile ApproachArchitecting for Change: An Agile Approach
Architecting for Change: An Agile Approach
Ben 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 Mainframe
VMware 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
 
Interface characteristics - Kim Clark and Brian Petrini
Interface characteristics - Kim Clark and Brian PetriniInterface characteristics - Kim Clark and Brian Petrini
Interface characteristics - Kim Clark and Brian Petrini
Kim Clark
 

Similar to Api pattern (20)

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...
 
Interface characteristics - Kim Clark and Brian Petrini
Interface characteristics - Kim Clark and Brian PetriniInterface characteristics - Kim Clark and Brian Petrini
Interface characteristics - Kim Clark and Brian Petrini
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 

Api pattern

  • 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