event-driven architecture

Post on 08-Jan-2017

330 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Event Driven Architecture Aprimer…

@ShawnWallace

The Great Debate…

MonolithFirst?

http://martinfowler.com/bliki/MonolithFirst.html

MicroservicesFirst?

http://martinfowler.com/articles/dont-start-monolith.html

Monolithic

Invoicing Inventory

Logging

Profiles

Warehouse

Orders

A problem with ‘Monolith First’

Aproductofouragileapproachtoourprojects…smallerfeaturesfinishedearlier.

ThegoalistodeploymoreoCen…thisishard.OnesoluDonistohavesmallerapplicaDons.

Monolithic

Invoicing Inventory

Logging

Profiles

Warehouse

Orders

SOA

Orders Invoicing Inventory

Logging Profiles Warehouse

SOA

Orders Invoicing Inventory

Logging Profiles Warehouse

TightlyCoupled

SOA with Enterprise Service Bus

Orders Invoicing Inventory

Logging Profiles Warehouse

STILLTightlyCoupled

EnterpriseServiceBus

Event Driven Architecture

• AnEventisrepresentssomethingthathappensinadomain•  CustomerSubmitsOrder•  CustomerBilled•  PaymentReceived•  OrderReadyforShipment•  OrderShipped

• WhileEventsandtheirpayloadaredesignedattheenterprisesystemlevel,theirimplementaDonsareleCtothespecificsubsystems.

Event Driven Architecture

• Nopoint-to-pointintegraDons•  Looselycoupled,highlyscalablesystems•  Looselycoupled,TEAMS•  Easiertotest•  Easiertochange•  TopologyagnosDc

Loosely Coupled

Orders Invoicing Inventory

Logging Profiles ReporDng

EventBus

Easy to Integrate New Systems

Orders Invoicing Inventory

Logging Profiles ReporDng

EventBus

NewSystem

Easy to Test

InventoryInventory

Inventory

Scales

Orders Invoicing Inventory

Logging Profiles ReporDng

EventBus

The basic thesis of this article is that organizations which design systems (in the broad sense used here) are constrained to produce designs which are copies of the communication structures of these organizations. --- Melvin Conway

Easily Modeled as a finite state diagram

Other benefits

•  Easeof3rdpartyintegraDon•  ExisDngsystemscanbe‘wrapped’• Canbedeliberateaboutscaling•  Faulttolerant•  Eventmessagescanbeloggedand‘replayed’• CantestsubsystemsinisolaDon

A Retail System

Sales Logger

Invoicing Shipping Warehouse

RabbitMQExchange

A Retail System – PlaLorm AgnosMc

Sales Logger

Invoicing Shipping Warehouse

RabbitMQExchange

Order Accepted Event is generated

Sales Logger

Invoicing Shipping Warehouse

RabbitMQExchange

Customer Billed Event

Sales Logger

Invoicing Shipping Warehouse

RabbitMQExchange

Order Ready for Shipment Event

Sales Logger

Invoicing Shipping Warehouse

RabbitMQExchange

Order Shipped

Sales Logger

Invoicing Shipping Warehouse

RabbitMQExchange

Logger Consumes EVERY Event

Sales Logger

Invoicing Shipping Warehouse

RabbitMQExchange

Logger Consumes EVERY Event

For Further Reading

•  THISpresentaDon(andcode)onGitHubhXps://github.com/shawnewallace/choreographed_process•  StephanNorbergEDAhXp://www.infoq.com/presentaDons/Domain-Event-Driven-Architecture•  “ProgrammingWithoutaCallStack”hXp://www.enterpriseintegraDonpaXerns.com/docs/EDA.pdf•  “Event-DrivenArchitectureOverview”• hXp://www.omg.org/soa/Uploaded%20Docs/EDA/bda2-2-06cc.pdf

Shawn WallaceWork:

shawn.wallace@centricconsulting.comTwitter: @ShawnWallace

Blog: blog.shawnewallace.comhttp://www.about.me/shawnwallace

•  Event-drivenarchitectureisaversaDleapproachtodesigningcomplexsoCwaresystems.ThesesystemstendtobeeasiertomodelforanorganizaDonasEDAembracesConway’sLawandcanoCenbemodeledasafinitestatemachine.Event-drivenarchitectureisnotanewconcept,butasmoreorganizaDonsembracemicroservices,thisapproachtosystemdesignhasbecomeappropriateinmoresituaDons.Inthistalkwe’ll:introduceevent-drivenarchitecture,talkaboutkeycomponents,lookatasampleimplementaDonofaretailsystem.

top related