api centric patterns

Post on 29-Jul-2015

168 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

PatternsForAPI CentricArchitecture

Daniel Cerecedo@dcerecedo

Byteflair

StatelessStateless

Byteflair

StatelessStateless

Client/Server

Byteflair

StatelessStateless

It's all about CLIENT STATE,not about the

global state of the system

Byteflair

StatelessStateless

Client requests provideALL the context thatthe Server needs to

Determine Client state

Byteflair

StatelessStateless

The state of the client is part of the payload

Byteflair

StatelessStateless

Stateless servers are core to

HORIZONTAL SCALING

Byteflair

Byteflair

Common ContractCommon Contract

Exchange protocol

Message format

Byteflair

Common ContractCommon Contract

Exchange protocol

Message format

Coupling

Byteflair

Common ContractCommon Contract

Byteflair

Byteflair

OrchestrationOrchestration

2

1

3

Byteflair

OrchestrationOrchestration

2

1

3

Byteflair

Mediation RouterMediation Router

Byteflair

Mediation RouterMediation Router

Intelligently ROUTES and TRANSFORMS messages, and

handles endpoint ERRORS

Byteflair

Mediation RouterMediation Router

✔ Load BalancerSpecify a group of components among which to load balance requests

✔ Dead LetterDeclare error conditions, retry policies and where to deliver the message on failure

✔ Content Based RoutingRoute a message to different endpoints based of its contents

✔ Dynamic RouterRoute a message to different endpoints based on the state of the system

✔ NormalizerTransform messages from heterogeneous formats into a common format

Byteflair

Mediation RouterMediation Router

Byteflair

Mediation RouterMediation Router

Byteflair

Byteflair

Message BrokerMessage Broker

A Message Broker supportsALL communication models:✔ Publish/Subscribe✔ Sync RPC✔ Async RPC

Byteflair

Message BrokerMessage Broker

A Message BrokerGUARANTEES the delivery

of a message

Byteflair

Byteflair

Service RegistryService Registry

Netflix Eureka

Byteflair

Service RegistryService Registry

Byteflair

Byteflair

Load BalancerLoad Balancer

Netflix Ribbon

Byteflair

Byteflair

Circuit BrakerCircuit Braker

Netflix Hystrix

Byteflair

Service DiscoveryService Discovery

Byteflair

Service DiscoveryService Discovery

Discovery client automatically resolves service names through the service registry

Byteflair

Service DiscoveryService Discovery

Client load balancer caches service instance locations to support service resolution in case the registry failure

Byteflair

Service DiscoveryService Discovery

Client load balancer selects a service instance among all available

Byteflair

Circuit BreakerCircuit Breaker

If we are unable to service a request we can shortcircuit and fallback graciously

Byteflair

StatelessService Discovery

Load BalancerCircuit Braker

Micro Services

Byteflair

Micro ServicesMicro ServicesMy wayMy way

Byteflair

Micro ServicesMicro ServicesMy wayMy way

Byteflair

ContainerizationContainerization

Byteflair

ContainerizationContainerization

Strict separation betweenbuild, release and run.

Releases are APPEND ONLY

Byteflair

ContainerizationContainerization

Infrastructure is IMMUTABLE

Byteflair

ContainerizationContainerization

Services are exportedvia PORT BINDING

Byteflair

ReferencesReferences

Spring CloudUsing cloud components with spring, specially Netflix OSShttp://projects.spring.io/spring-cloud/Flux CapacitorJava-based, cloud-native, reference architecture using many Netflix Open Source projectshttps://github.com/cfregly/fluxcapacitor12 Factor APPMethodology for building software-as-a-service appshttp://12factor.net/ShipyardComposable docker managementhttp://shipyard-project.com/

?ThanksThanksMerciMerciGraciasGracias

http://byteflair.comDaniel Cerecedo

@dcerecedo

top related