SlideShare a Scribd company logo
1 of 45
SPRINGONE2GX
WASHINGTON, DC
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attributio n-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
Shared I/O State in API
Architecture
By Owen Rubel
@OwenRubel
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Owen Rubel
• Original team member of Amazon 95-98
• Creator of API Chaining, API Abstraction and IO
State
• Grails API Toolkit
• twitter: @owenrubel
• linkedin: https://www.linkedin.com/in/orubel
2
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
First a Warning…
3
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Centralized vs Distributed Architecture
• How many developers still use a centralized architecture vs a
distributed architecture in their development?
4
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Centralized vs Distributed Architecture
• 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?
5
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Centralized vs Distributed Architecture
• 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?
• Pattern existed since the 80’s(???)
• 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
6
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
But What is The API Pattern?
7
“…specifies a software component in terms of its operations, their
inputs and outputs and underlying types. Its main purpose is to define a
set of functionalities that are independent of their respective
implementation…”
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Thus an API is:
• Separation of concern with a bound secondary concern
• communication logic bound to business logic
8
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
And There Are Two Ways To Implement:
• API As Software Pattern (Centralized Architecture)
• API As Architectural Pattern (Distributed Architecture)
9
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
API as a Software Pattern (Centralized Architecture)
10
I/O
RESOURCE MGMT
REQUEST RESPONSE
COMMUNICATION
LOGIC
CLIENT CLIENT
CONTROLLER
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
API as an Architectural Pattern (Distributed Architecture)
11
I/O
RESOURCE MGMT
REQUEST RESPONSE
HANDLER
INTERCEPTOR
PROXY MQ
CONTROLLER
REQUEST
RESPONSE
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Sharing I/O Flow but NOT Sharing I/O Data
12
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
HANDLER
INTERCEPTOR
Mixed Implementation : Software Pattern in an Architectural Pattern
(Part 1)
13
REQUEST
COMMUNICATION
LOGIC
PROXY MQ
CONTROLLER
RESPONSE
RestfulController,
@RequestMapping,
@RequestParam,
@ResponseBody,
@PathVariable
I/O
RESOURCE MGMT
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Mixed Patterns: Issues?
• Duplicate Code
• Duplicate Handling of Flow
• Software Confusion
• Architectural Confusion
• Cross Cutting Concerns
• Inability to share I/O state with services that share I/O flow
14
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Mixed Implementation: Duplicitous Code (Part 2)
15
@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
…
}
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Mixed Implementation :Manually Coding of Flow (Part 3)
16
REQUEST
COMMUNICATION
LOGIC
PROXY MQ
CONTROLLER
RESPONSE
Automated
flow
PRE POST
Manually Encoded
flow per method
HANDLER INTERCEPTOR
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Mixed Implementation :Dropped Threads (Part 3)
17
REQUEST
COMMUNICATION
LOGIC
PROXY
w/ Security
MQ
CONTROLLER
RESPONSEPRE POST
HANDLER
INTERCEPTOR
Dropped Thread and IO bound
REDIRECT
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
“This Fixes Everything That We Are Currently
Having Issues With!”
18
- API Manager, Netflix
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Mixed Architecture: Inability to Share Data w/ Architecture (Part 4)
19
HANDLER
INTERCEPTO
R
REQUES
T
COMMUNICATION
LOGIC
PROX
Y
MQ
CONTROLLE
R
RESPONS
E
post/show/1
{GET,JSON,
ROLE_ADMIN
} {…}
RestfulController,
@RequestMapping,
@RequestParam,
@ResponseBody,
@PathVariable
???
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
The API Pattern is Either Application OR
Architecture…
But Not Both!
20
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Benefits of an API as Architecture?
• Easier to abstract components
• Once components abstracted, easier to share with services using IO flow
• Can separate data from functionality
• Check security early and late in proxy and MQ; can also check security in
handlerInterceptor on redirect/forward.
• More Scalable… both Vertically and Horizontally due to better separation.
• Made for Automation (Batching, api chaining, api doc generation based on roles, etc)
• Api Multi-tenancy (functionality can be split, combined, joined without application
rewrite)
• Vast reduction in code required; no duplication in controllers.
• Shared IO State for sharing with IO flow
21
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
So How Do We Solve?
22
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Web API (as the Application) : Shared Architecture
23
REQUEST RESPONSE
HANDLER
INTERCEPTOR
PROXY MQ
CONTROLLER
I/O
RESOURCE MGMT
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
So How Do We Share the Data Across the
Architecture?
24
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Cached I/O State in Architecture
25
REQUEST
HANDLER
INTERCEPTOR
PROXY MQ
CONTROLLER
CACHE (I/O STATE)
SUB/PUB
RESPONSE
SUB/PUB
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
So What is I/O State?
26
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
I/O State : Communications Rules
27
I/O State is data directly related to a request/response, normally separated
from functionality. Handles all data associated with communication and
communication access
• Caches Communications Data
• Synchronizes Architectural Properties
• Handles API Authorizations
• Api Docs Definitions
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
I/O State
28
• all the data contained in annotations act as rules associated with the uri endpoint
• by containing all those rules in one file and caching that data, we can share it with
the other architectural components
• this enables us to change it on the fly and reload without having to restart any
services and subscribed services will have changes published to them through
web hooks
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
I/O State : A Cached Communications Property File
29
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.
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Shared I/O State
• DOESN’T bind to the application
• DOESN’T bind to functionality
• DOESN’T bind to a resource
30
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
What Does It Look Like?
31
https://gist.github.com/orubel/7c4d0290c7b8896667a3
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
What Shared I/O State Maintains…
32
• Values provided for Input/Output
• All Endpoints
• Endpoint Authorization (ie Roles)
• Endpoint Request Method (GET, PUT, POST, DELETE)
• Expected Input per Endpoint
• Expected Output per Endpoint
• Version for document
• Deprecation Date for document
• Batching Authorization (and toggle)
• and more
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Similar technologies (and How They Compare)
• Api Blueprint
• confuses I/O state with delivery content (which doesn’t need to be shared)
• duplicitous; lack of separation
• no roles
• Swagger
• not role based
• based on annotations and thus not sharable in distributed architecture
• only focused on API docs
• duplicitous; lack of separation
• RAML
• not role based
• limited to ‘traditional’ REST of 4 calls per class
• duplicitous; lack of separation
33
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Controller : Mixed Concerns (Duplication)
34
@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
…
}
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Controller : Mixed Concerns (Duplication)
35
@RequestMapping(value="/create", method=RequestMethod.POST)
@ResponseBody
public ModelAndView createAddress(){
User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id)
Address address = new Address(params)
address.user = user
…
}
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Controller : Single Concern
36
public ModelAndView createAddress(){
User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id)
Address address = new Address(params)
address.user = user
…
}
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Ok But How Does it Work W/O Annotations?
37
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Bootstrap : Load Data into Cache
38
class ApiBootStrap {
def apiObjectService
def init = { servletContext ->
apiObjectService.initialize()
}
def destroy = {}
}
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Url Mapping : Map Endpoints
39
static mappings = {
String apiVersion = getGrailsApplication().metadata['info.app.version']
String api = "v${apiVersion}"
// REGULAR API ENDPOINTS
"/$api/$controller/$action?/$id?(.$format)?"{
parseRequest = true
}
"/$api/$controller/$action/$id**" {
parseRequest = true
}
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
HandlerInterceptor: Run checks on Requests Against Cache
40
boolean before(){
LinkedHashMap cache = (params.controller)?apiCacheService.getApiCache(params.controller):[:]
if(cache){
boolean result = apiRequestService.handleApiRequest(cache,request,params)
return result}
return false
}
boolean after(){
Map newModel = (model)?apiResponseService.convertModel(model):model
Map cache = (params.controller)?apiCacheService.getApiCache(params.controller):[:]
Map content = apiResponseService.handleApiResponse(cache,request,response,newModel,params)
if(content){
render(text:content.apiToolkitContent, contentType:"${content.apiToolkitType}",
encoding:content.apiToolkitEncoding)
return false}
return false
}
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Flow
41
PREHANDLER REQUESTSERVICE POSTHANDLER RESPONSESERVICECONTROLLER
request
response
after()
controller/action
handleApiRequest
handleApiResponse
model, headers, etc
true/falsefalse
true
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
To Create Something Like This…
42
https://gist.github.com/orubel/d5b161332b5a788828eb
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Demo
43
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Questions?
44
SPRINGONE2GX
WASHINGTON, DC
Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attributio n-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/
• API Chaining and API Abstraction (http://www.slideshare.net/bobdobbes/api-
abstraction-api-chaining)
• The API is Dead, Long Live The API (http://www.dev9.com/article/2015/9/api-is-
dead)
• Why the API Pattern is Broken and How We Can Fix It
(http://apievangelist.com/2015/05/05/guest-post-why-the-api-pattern-is-broken-
and-how-we-can-fix-it/)
Additional Links

More Related Content

What's hot

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
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?LunchBadger
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservicesKunal Hire
 
Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)José Roberto Araújo
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway Chris Mague
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API PlatformJohannes Ridderstedt
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...apidays
 
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...apidays
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy IntroductionDoug Gregory
 
Create your own OPC UA information model
Create your own OPC UA information modelCreate your own OPC UA information model
Create your own OPC UA information modelStephane Potier
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & GuidelinesPrabath Siriwardena
 
Gobierno de apis
Gobierno de apisGobierno de apis
Gobierno de apisCloudAppi
 
AWS Global Infrastructure Foundations
AWS Global Infrastructure Foundations AWS Global Infrastructure Foundations
AWS Global Infrastructure Foundations Amazon Web Services
 

What's hot (20)

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
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
 
Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)Aggregating API Services with an API Gateway (BFF)
Aggregating API Services with an API Gateway (BFF)
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
Api Gateway
Api GatewayApi Gateway
Api Gateway
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
 
Hexagonal And Beyond
Hexagonal And BeyondHexagonal And Beyond
Hexagonal And Beyond
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
 
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
 
Kong
KongKong
Kong
 
API Strategy Introduction
API Strategy IntroductionAPI Strategy Introduction
API Strategy Introduction
 
Create your own OPC UA information model
Create your own OPC UA information modelCreate your own OPC UA information model
Create your own OPC UA information model
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & Guidelines
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Gobierno de apis
Gobierno de apisGobierno de apis
Gobierno de apis
 
API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0
 
AWS Global Infrastructure Foundations
AWS Global Infrastructure Foundations AWS Global Infrastructure Foundations
AWS Global Infrastructure Foundations
 

Similar to IO State In Distributed API Architecture

How to Manage Microservices and APIs with Apigee and Istio
How to Manage Microservices and APIs with Apigee and IstioHow to Manage Microservices and APIs with Apigee and Istio
How to Manage Microservices and APIs with Apigee and IstioVMware Tanzu
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsMatt Stine
 
My Personal DevOps Journey: From Pipelines to Platforms
My Personal DevOps Journey: From Pipelines to PlatformsMy Personal DevOps Journey: From Pipelines to Platforms
My Personal DevOps Journey: From Pipelines to PlatformsVMware Tanzu
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsVMware Tanzu
 
Introduction to Reactive Streams and Reactor 2.5
Introduction to Reactive Streams and Reactor 2.5Introduction to Reactive Streams and Reactor 2.5
Introduction to Reactive Streams and Reactor 2.5Stéphane Maldini
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive ProgrammingStéphane Maldini
 
Intro To Reactive Programming
Intro To Reactive ProgrammingIntro To Reactive Programming
Intro To Reactive ProgrammingRossen Stoyanchev
 
Securing Microservices with Spring Cloud Security
Securing Microservices with Spring Cloud SecuritySecuring Microservices with Spring Cloud Security
Securing Microservices with Spring Cloud SecurityWill Tran
 
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...cornelia davis
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott AndrewsVMware Tanzu
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Springsdeeg
 
P to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersP to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersVMware Tanzu
 
Extending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud FoundryExtending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud FoundryKenny Bastani
 
Extending the Platform
Extending the PlatformExtending the Platform
Extending the PlatformVMware Tanzu
 
YugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
YugaByte DB—A Planet-Scale Database for Low Latency Transactional AppsYugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
YugaByte DB—A Planet-Scale Database for Low Latency Transactional AppsVMware Tanzu
 
Living on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora IberkleidLiving on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora IberkleidVMware Tanzu
 
Living on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora IberkleidLiving on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora IberkleidVMware Tanzu
 
How to Build More Secure Service Brokers
How to Build More Secure Service BrokersHow to Build More Secure Service Brokers
How to Build More Secure Service BrokersVMware Tanzu
 
Accelerating the Consumption of APIs Built on Cloud Foundry
Accelerating the Consumption of APIs Built on Cloud FoundryAccelerating the Consumption of APIs Built on Cloud Foundry
Accelerating the Consumption of APIs Built on Cloud FoundryVMware Tanzu
 

Similar to IO State In Distributed API Architecture (20)

How to Manage Microservices and APIs with Apigee and Istio
How to Manage Microservices and APIs with Apigee and IstioHow to Manage Microservices and APIs with Apigee and Istio
How to Manage Microservices and APIs with Apigee and Istio
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring Applications
 
My Personal DevOps Journey: From Pipelines to Platforms
My Personal DevOps Journey: From Pipelines to PlatformsMy Personal DevOps Journey: From Pipelines to Platforms
My Personal DevOps Journey: From Pipelines to Platforms
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices Deployments
 
Introduction to Reactive Streams and Reactor 2.5
Introduction to Reactive Streams and Reactor 2.5Introduction to Reactive Streams and Reactor 2.5
Introduction to Reactive Streams and Reactor 2.5
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive Programming
 
Intro To Reactive Programming
Intro To Reactive ProgrammingIntro To Reactive Programming
Intro To Reactive Programming
 
Securing Microservices with Spring Cloud Security
Securing Microservices with Spring Cloud SecuritySecuring Microservices with Spring Cloud Security
Securing Microservices with Spring Cloud Security
 
Serverless Spring 오충현
Serverless Spring 오충현Serverless Spring 오충현
Serverless Spring 오충현
 
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott Andrews
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Spring
 
P to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersP to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to Containers
 
Extending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud FoundryExtending the Platform with Spring Boot and Cloud Foundry
Extending the Platform with Spring Boot and Cloud Foundry
 
Extending the Platform
Extending the PlatformExtending the Platform
Extending the Platform
 
YugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
YugaByte DB—A Planet-Scale Database for Low Latency Transactional AppsYugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
YugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
 
Living on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora IberkleidLiving on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora Iberkleid
 
Living on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora IberkleidLiving on the Edge With Spring Cloud Gateway - Cora Iberkleid
Living on the Edge With Spring Cloud Gateway - Cora Iberkleid
 
How to Build More Secure Service Brokers
How to Build More Secure Service BrokersHow to Build More Secure Service Brokers
How to Build More Secure Service Brokers
 
Accelerating the Consumption of APIs Built on Cloud Foundry
Accelerating the Consumption of APIs Built on Cloud FoundryAccelerating the Consumption of APIs Built on Cloud Foundry
Accelerating the Consumption of APIs Built on Cloud Foundry
 

Recently uploaded

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Recently uploaded (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

IO State In Distributed API Architecture

  • 1. SPRINGONE2GX WASHINGTON, DC Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attributio n-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/ Shared I/O State in API Architecture By Owen Rubel @OwenRubel
  • 2. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Owen Rubel • Original team member of Amazon 95-98 • Creator of API Chaining, API Abstraction and IO State • Grails API Toolkit • twitter: @owenrubel • linkedin: https://www.linkedin.com/in/orubel 2
  • 3. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ First a Warning… 3
  • 4. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Centralized vs Distributed Architecture • How many developers still use a centralized architecture vs a distributed architecture in their development? 4
  • 5. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Centralized vs Distributed Architecture • 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? 5
  • 6. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Centralized vs Distributed Architecture • 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? • Pattern existed since the 80’s(???) • 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 6
  • 7. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ But What is The API Pattern? 7 “…specifies a software component in terms of its operations, their inputs and outputs and underlying types. Its main purpose is to define a set of functionalities that are independent of their respective implementation…”
  • 8. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Thus an API is: • Separation of concern with a bound secondary concern • communication logic bound to business logic 8
  • 9. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ And There Are Two Ways To Implement: • API As Software Pattern (Centralized Architecture) • API As Architectural Pattern (Distributed Architecture) 9
  • 10. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ API as a Software Pattern (Centralized Architecture) 10 I/O RESOURCE MGMT REQUEST RESPONSE COMMUNICATION LOGIC CLIENT CLIENT CONTROLLER
  • 11. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ API as an Architectural Pattern (Distributed Architecture) 11 I/O RESOURCE MGMT REQUEST RESPONSE HANDLER INTERCEPTOR PROXY MQ CONTROLLER REQUEST RESPONSE
  • 12. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Sharing I/O Flow but NOT Sharing I/O Data 12
  • 13. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ HANDLER INTERCEPTOR Mixed Implementation : Software Pattern in an Architectural Pattern (Part 1) 13 REQUEST COMMUNICATION LOGIC PROXY MQ CONTROLLER RESPONSE RestfulController, @RequestMapping, @RequestParam, @ResponseBody, @PathVariable I/O RESOURCE MGMT
  • 14. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Mixed Patterns: Issues? • Duplicate Code • Duplicate Handling of Flow • Software Confusion • Architectural Confusion • Cross Cutting Concerns • Inability to share I/O state with services that share I/O flow 14
  • 15. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Mixed Implementation: Duplicitous Code (Part 2) 15 @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 … }
  • 16. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Mixed Implementation :Manually Coding of Flow (Part 3) 16 REQUEST COMMUNICATION LOGIC PROXY MQ CONTROLLER RESPONSE Automated flow PRE POST Manually Encoded flow per method HANDLER INTERCEPTOR
  • 17. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Mixed Implementation :Dropped Threads (Part 3) 17 REQUEST COMMUNICATION LOGIC PROXY w/ Security MQ CONTROLLER RESPONSEPRE POST HANDLER INTERCEPTOR Dropped Thread and IO bound REDIRECT
  • 18. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ “This Fixes Everything That We Are Currently Having Issues With!” 18 - API Manager, Netflix
  • 19. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Mixed Architecture: Inability to Share Data w/ Architecture (Part 4) 19 HANDLER INTERCEPTO R REQUES T COMMUNICATION LOGIC PROX Y MQ CONTROLLE R RESPONS E post/show/1 {GET,JSON, ROLE_ADMIN } {…} RestfulController, @RequestMapping, @RequestParam, @ResponseBody, @PathVariable ???
  • 20. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The API Pattern is Either Application OR Architecture… But Not Both! 20
  • 21. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Benefits of an API as Architecture? • Easier to abstract components • Once components abstracted, easier to share with services using IO flow • Can separate data from functionality • Check security early and late in proxy and MQ; can also check security in handlerInterceptor on redirect/forward. • More Scalable… both Vertically and Horizontally due to better separation. • Made for Automation (Batching, api chaining, api doc generation based on roles, etc) • Api Multi-tenancy (functionality can be split, combined, joined without application rewrite) • Vast reduction in code required; no duplication in controllers. • Shared IO State for sharing with IO flow 21
  • 22. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ So How Do We Solve? 22
  • 23. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Web API (as the Application) : Shared Architecture 23 REQUEST RESPONSE HANDLER INTERCEPTOR PROXY MQ CONTROLLER I/O RESOURCE MGMT
  • 24. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ So How Do We Share the Data Across the Architecture? 24
  • 25. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Cached I/O State in Architecture 25 REQUEST HANDLER INTERCEPTOR PROXY MQ CONTROLLER CACHE (I/O STATE) SUB/PUB RESPONSE SUB/PUB
  • 26. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ So What is I/O State? 26
  • 27. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ I/O State : Communications Rules 27 I/O State is data directly related to a request/response, normally separated from functionality. Handles all data associated with communication and communication access • Caches Communications Data • Synchronizes Architectural Properties • Handles API Authorizations • Api Docs Definitions
  • 28. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ I/O State 28 • all the data contained in annotations act as rules associated with the uri endpoint • by containing all those rules in one file and caching that data, we can share it with the other architectural components • this enables us to change it on the fly and reload without having to restart any services and subscribed services will have changes published to them through web hooks
  • 29. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ I/O State : A Cached Communications Property File 29 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.
  • 30. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Shared I/O State • DOESN’T bind to the application • DOESN’T bind to functionality • DOESN’T bind to a resource 30
  • 31. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What Does It Look Like? 31 https://gist.github.com/orubel/7c4d0290c7b8896667a3
  • 32. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What Shared I/O State Maintains… 32 • Values provided for Input/Output • All Endpoints • Endpoint Authorization (ie Roles) • Endpoint Request Method (GET, PUT, POST, DELETE) • Expected Input per Endpoint • Expected Output per Endpoint • Version for document • Deprecation Date for document • Batching Authorization (and toggle) • and more
  • 33. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Similar technologies (and How They Compare) • Api Blueprint • confuses I/O state with delivery content (which doesn’t need to be shared) • duplicitous; lack of separation • no roles • Swagger • not role based • based on annotations and thus not sharable in distributed architecture • only focused on API docs • duplicitous; lack of separation • RAML • not role based • limited to ‘traditional’ REST of 4 calls per class • duplicitous; lack of separation 33
  • 34. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Controller : Mixed Concerns (Duplication) 34 @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 … }
  • 35. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Controller : Mixed Concerns (Duplication) 35 @RequestMapping(value="/create", method=RequestMethod.POST) @ResponseBody public ModelAndView createAddress(){ User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id) Address address = new Address(params) address.user = user … }
  • 36. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Controller : Single Concern 36 public ModelAndView createAddress(){ User user= (params.id)?User.get(params.id.toLong()): User.get(principal.id) Address address = new Address(params) address.user = user … }
  • 37. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Ok But How Does it Work W/O Annotations? 37
  • 38. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Bootstrap : Load Data into Cache 38 class ApiBootStrap { def apiObjectService def init = { servletContext -> apiObjectService.initialize() } def destroy = {} }
  • 39. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Url Mapping : Map Endpoints 39 static mappings = { String apiVersion = getGrailsApplication().metadata['info.app.version'] String api = "v${apiVersion}" // REGULAR API ENDPOINTS "/$api/$controller/$action?/$id?(.$format)?"{ parseRequest = true } "/$api/$controller/$action/$id**" { parseRequest = true }
  • 40. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ HandlerInterceptor: Run checks on Requests Against Cache 40 boolean before(){ LinkedHashMap cache = (params.controller)?apiCacheService.getApiCache(params.controller):[:] if(cache){ boolean result = apiRequestService.handleApiRequest(cache,request,params) return result} return false } boolean after(){ Map newModel = (model)?apiResponseService.convertModel(model):model Map cache = (params.controller)?apiCacheService.getApiCache(params.controller):[:] Map content = apiResponseService.handleApiResponse(cache,request,response,newModel,params) if(content){ render(text:content.apiToolkitContent, contentType:"${content.apiToolkitType}", encoding:content.apiToolkitEncoding) return false} return false }
  • 41. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Flow 41 PREHANDLER REQUESTSERVICE POSTHANDLER RESPONSESERVICECONTROLLER request response after() controller/action handleApiRequest handleApiResponse model, headers, etc true/falsefalse true
  • 42. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ To Create Something Like This… 42 https://gist.github.com/orubel/d5b161332b5a788828eb
  • 43. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo 43
  • 44. Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Questions? 44
  • 45. SPRINGONE2GX WASHINGTON, DC Unless otherwise indicated, these slides are © 2013 -2015 Pivotal Software, Inc. and licensed under a Creative Commons Attributio n-NonCommercial license: http://creativecommons.org/licenses/by -nc/3.0/ • API Chaining and API Abstraction (http://www.slideshare.net/bobdobbes/api- abstraction-api-chaining) • The API is Dead, Long Live The API (http://www.dev9.com/article/2015/9/api-is- dead) • Why the API Pattern is Broken and How We Can Fix It (http://apievangelist.com/2015/05/05/guest-post-why-the-api-pattern-is-broken- and-how-we-can-fix-it/) Additional Links

Editor's Notes

  1. work on title perhaps something less intimidating; more relatable to work they are doing without ‘fancy names’
  2. What I am about to show you will: amaze anger shock annoy astound and confuse can be controversial May not get it immediately. Those that do will walk out of here looking at api development with new eyes… thats a promise. You will never see them the same way again. I’m going to tell you right now that this is a rethinking of the api pattern and a lot of its premises in how it is implemented so if you are not ready for a bumpy ride or if you have a weak heart, I’ll give you a moment to step outside… … ok and with that…
  3. let me ask you this…
  4. the reason I bring this up… This number used to be around 50% in 2005. Now, it’s roughly 25-30% now… and going down. the api pattern was originally designed for software applications (centralized architecture)
  5. but what is an api? In Short: An API is a separation of concern of I/O for functionality of resource management
  6. - For example…
  7. Now the most common way is…api as software pattern This is ONE software application… or a piece of software contained within ONE software application (creating a centralized architecture). Here concerns are separated standardized input/output to a separation of concern within the application the separation of concern binds communication logic to a service which does resource mngmt (ie the resource that is requested, manipulated and returned) api as architectural pattern is api as service amongst multiple connected software services (creating a distributed architecture). The api pattern for architecture is IDENTICAL except the separation of concern is a software component separated from other software components… not concerns separated from other concerns. In a distributed architecture, we can see: there is already I/O and resource management in the standard MVC application with request/response coming/going to other architectural components … everything is mapped. This is STILL a centralized architecture at this point but has the POTENTIAL to be more easily become a DISTRIBUTED architecture Unfortunately, we didn’t understand that api is architecture as well as software and so when applying it to the web, we applied the the software pattern rather than the architectural pattern
  8. For as you see when we add other services, we can share the I/O flow. But now we have a problem…
  9. Current implementations in distributed architectures are not so NEAT.
  10. This creates a mixed implementation. creating massive redundancy and duplication with every method.
  11. Software confusion: where do we handle batch jobs? Where do we do checking? how do we handle loopback and redirect? Architectural confusion: how do we share with external services? What do we share? How do we keep things in sync across architectural components and api instance?
  12. We literally have to duplicate this information with EVERY method then , as you can see in the body, we have to do additional checks for multiple roles handling this. This can’t be separated and moved to the PROXY without duplicating or entanglement making it impossible to synchronize this data. Thus overtime this data changes, it requires ‘human intervention’ to make sure ever instance of it remains synchronized due to this ‘hard coding’.
  13. having to manually code the flow creates massive code duplication it also makes it so you have to shut down the server and bring it back up overtime you want to add something new to the flow by using existing communication layer, this reduces duplication and allows you to merely uses properties as toggles finally, flow cannot be easily isolated and moved to separate server without creating entirely separate project; as separate layer, can be detected at proxy and sent to separate server to have separate functionality handled so as to not affect unaffected processes. example: api batching
  14. having to manually code the flow creates massive code duplication it also makes it so you have to shut down the server and bring it back up overtime you want to add something new to the flow by using existing communication layer, this reduces duplication and allows you to merely uses properties as toggles finally, flow cannot be easily isolated and moved to separate server without creating entirely separate project; as separate layer, can be detected at proxy and sent to separate server to have separate functionality handled so as to not affect unaffected processes. example: api batching
  15. When I showed this to Netflix and how their tools like Zuul were doing precisely this, this is how the api manager responded. And that not all…
  16. Data stored/used in annotations cannot be shared with architectural components without duplication. Annotations cant be cached as they would exist in two places: the controllers and the cache; this data would be impossible to sychronize. This is what is known as an architectural cross cutting concern as it creates duplication and/or entanglement. Thus at this point we can easily state…
  17. These two concepts cannot be reconciled without created a cross cutting concern every time. Mixing the two causes api as an architectural pattern to DEFAULT to being an api as a software pattern and thus a centralized architecture. The modern web api is a mixture of these two and as such has issues in scaling in distributed architectures as a result of creating this architectural cross cutting concern. The solution is to apply the api pattern as architecture and not as software. Only then can you resolve issue with architectural components as you scale your application.
  18. we need to see api as separation of SERVICE rather than separation of concern we don’t need to add anything here as all the necessary structure is already in place we just need to code our logic in correct places (communication logic in handler interceptor and business logic in controllers)
  19. By preloading the IO state at runtime, we can: share with all subscribed services to the api through a pub/sub model via web hooks all the data contained in annotations act as rules associated with the uri endpoint by containing all those rules in one file and caching that data, we can share it with the other architectural components then we can change and it on the fly and reload without having to restart any components and subscribed services will have changes published to them through web hooks
  20. no its not a college in the midwest
  21. There are two types of IO state… What does it do?
  22. It is a complete separation
  23. well in Grails, without giving away too much of the secret sauce right now, I did it in the handler interceptor like this…
  24. You’ll notice in this example the controller is doing ALOT of additional work: role checking request.method enforcement uri mapping input checking A lot of I/O and security that has been tacked on; these are not part of its ‘separation of concern’ and need to be shared with the architectural components.
  25. The controller is now a proper separation of concern and is STRICTLY focused on business logic
  26. At runtime, we bootstrap the files so that are loaded and cached…
  27. Then in urlmapping, we create a default mapping based on app version to handle all mappings…
  28. The controller is now a proper separation of concern and is STRICTLY focused on business logic
  29. The controller is now a proper separation of concern and is STRICTLY focused on business logic