event-driven architecture in the cloud · event-driven architecture in the cloud 14 microservices...

42
1 Event-Driven Architecture in the Cloud @ChadGreen Event-Driven Architecture in the Cloud DevUp Chad Green October 16, 2019

Upload: others

Post on 09-Aug-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

1Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture in the CloudDevUp

Chad GreenOctober 16, 2019

Page 2: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

2Event-Driven Architecture in the Cloud@ChadGreen

Silver Sponsors

Platinum Sponsors

Celebration Sponsor Lanyards Sponsor

Notebook Sponsor Registration Sponsor

Page 3: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

3Event-Driven Architecture in the Cloud@ChadGreen

u)

2

#

[email protected]

Chad GreenDirector of Software DevelopmentScholarRx

chadwickegreenChadGreenChadGreen.com

Page 4: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

4Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture in the CloudPreamble

Page 5: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

5Event-Driven Architecture in the Cloud@ChadGreen

Enterprise Architecture

Enterprise architecture applies architecture principles and practices to guide organizations through the business, information, process,

and technology changes necessary to execute their strategies.

- Wikipedia -

Page 6: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

6Event-Driven Architecture in the Cloud@ChadGreen

MonolithEnterprise Architecture

DatabaseUI

Order Processing

Payment Processing

Inventory Management

Notification

Fulfillment

Page 7: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

7Event-Driven Architecture in the Cloud@ChadGreen

MicroservicesEnterprise Architecture

UI

API

Gateway

OrderProcessing 0

InventoryManagement 0

Fulfilment0

Payment Processing0

Notifications0

Page 8: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

8Event-Driven Architecture in the Cloud@ChadGreen

Process FlowMicroservices

UI API Gateway Order Processing Payment Processing Inventory Management Notification Fulfilment

Place Order Place Order Charge Credit Card

Return Conf Num

Update Inventory

ReturnConfirmation

Send OrderConfirmation

Confirm

Create Shipping Label

Confirm

Return Confirmation

Return Confirmation

Page 9: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

9Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture

A software architecture pattern promoting the production, detection,

consumption of, and reaction to events.

- Wikipedia -

Page 10: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

10Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture

Page 11: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

11Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture

Page 12: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

12Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture

Event-driven architecture (EDA) is a design paradigm in which a software component executes in response to receiving one or more event

notifications.

- Gartner -

EDA is more loosely coupled than the client/server paradigm because the component that sends the notification doesn’t know the identity of the

receiving components at the time of compiling.

Page 13: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

13Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture

Event Producer Event Ingestion Event Consumer

Event Consumer

Event Consumer

Page 14: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

14Event-Driven Architecture in the Cloud@ChadGreen

MicroservicesEnterprise Architecture

UI API Gateway Order Processing Payment Processing Inventory Management Notification Fulfilment

Place Order Place Order Charge Credit Card

Return Conf Num

Update Inventory

ReturnConfirmation

Send OrderConfirmation

Confirm

Create Shipping Label

Confirm

Return Confirmation

Return Confirmation

Page 15: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

15Event-Driven Architecture in the Cloud@ChadGreen

Process FlowEvent-Driven Architecture

UI

API Gateway

Place Order

Order Processing

Place Order

Payment Processing

Charge Credit Card

Event Hub

Inventory Management

Notifications

Fulfilment

Notify Subscribers

Update Inventory

Send Order Confirmation

Create Shipping Label

Page 16: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

16Event-Driven Architecture in the Cloud@ChadGreen

Not Queue Based ProcessingEvent-Driven Architecture

UI

API Gateway

Place Order

Order Processing

Place Order

Payment Processing

Charge Credit Card

Update Inventory Queue

Inventory Management

Notifications

Fulfilment

Update Inventory

Send Order Confirmation

Create Shipping Label

Order Confirm Queue

Fulfilment Queue

Send Message to Queue

Send Message to Queue

Page 17: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

17Event-Driven Architecture in the Cloud@ChadGreen

Event Producer Event Ingestion Event Consumer

Event Consumer

Event Consumer

Event Consumption ModelsEvent-Driven Architecture

Pub/Sub Event Streaming

Page 18: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

18Event-Driven Architecture in the Cloud@ChadGreen

Consumer Processing VariationsEvent-Driven Architecture

Event Consumer

Event Consumer

Event Consumer

Simple Event Processing

Complex Event Processing

Event Stream Processing

Page 19: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

19Event-Driven Architecture in the Cloud@ChadGreen

Event Producer Event Ingestion Event Consumer

Event Consumer

Event Consumer

External Event SourcesEvent-Driven Architecture

A

Page 20: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

20Event-Driven Architecture in the Cloud@ChadGreen

Event Producer Event Ingestion Event Consumer

Event Consumer

Event Consumer

Multiple Consumer InstancesEvent-Driven Architecture

Event ConsumerEvent Consumer

Event Consumer

Event ConsumerEvent ConsumerEvent Consumer

Event ConsumerEvent Consumer

Event Consumer

Page 21: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

21Event-Driven Architecture in the Cloud@ChadGreen

Multiple Subsystems

Multiple subsystems must process the same

events.

Real-Time Processing

Real-time processing with minimum time lag.

Complex Event Processing

Complex event processing, such as pattern matching or

aggregation over time windows.

High Volume/Velocity Data

High volume and high velocity of data, such as

IoT.

When to use this architectureEvent-Driven Architecture

Page 22: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

22Event-Driven Architecture in the Cloud@ChadGreen

Decoupling Encapsulation Responsive

Scalable/Distributed Independence

BenefitsEvent-Driven Architecture

Page 23: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

23Event-Driven Architecture in the Cloud@ChadGreen

Steep Learning Curve Complexity

Loss of Transactionality Lineage

DrawbacksEvent-Driven Architecture

Page 24: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

24Event-Driven Architecture in the Cloud@ChadGreen

Guaranteed Delivery Sequencing

ChallengesEvent-Driven Architecture

Page 25: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

25Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture in the CloudImplementation Options

Page 26: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

26Event-Driven Architecture in the Cloud@ChadGreen

Implementation Options

PieSync TIBCO Spotfire Amazon Kinesis Amazon Elasticsearch Service

Google Cloud Pub/Sub StreamSets PubNub Data Stream

The PI System The PI System Confluent HVR Antiunity Replicate SQLstream IBM Streaming Analytics

Astronomer Striim Azure Event HubsAzure Service Bus IoT Hubs

Page 27: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

27Event-Driven Architecture in the Cloud@ChadGreen

Azure Event HubsSimple, secure, and scalable real-time data ingestion

PieSync TIBCO Spotfire Amazon Kinesis Amazon Elasticsearch Service

Google Cloud Pub/Sub StreamSets PubNub Data Stream

The PI System The PI System Confluent HVR Antiunity Replicate SQLstream IBM Streaming Analytics

Astronomer Striim Azure Event Hubs

Implementation Options

Fully managed, real-time data ingestion service that is

simple, trusted, and scalable.

Azure Service Bus IoT Hubs

Page 28: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

28Event-Driven Architecture in the Cloud@ChadGreen

Why choose Event Hubs?Azure Event Hubs

Simple Secure

Scalable Open

Page 29: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

29Event-Driven Architecture in the Cloud@ChadGreen

Key Architecture ComponentsAzure Event Hubs

Event Producers

Page 30: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

30Event-Driven Architecture in the Cloud@ChadGreen

Key Architecture ComponentsAzure Event Hubs

Partitions

Page 31: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

31Event-Driven Architecture in the Cloud@ChadGreen

Key Architecture ComponentsAzure Event Hubs

Consumer Groups

Page 32: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

32Event-Driven Architecture in the Cloud@ChadGreen

Key Architecture ComponentsAzure Event Hubs

Throughput Units

Page 33: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

33Event-Driven Architecture in the Cloud@ChadGreen

Key Architecture ComponentsAzure Event Hubs

Event Receivers

Page 34: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

34Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture in the CloudDemonstration

Page 35: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

35Event-Driven Architecture in the Cloud@ChadGreen

ScenarioDemonstration

UI

API Gateway

Place Order

Order Processing

Place Order

Payment Processing

Charge Credit Card

Event Hub

Inventory Management

Notifications

Fulfilment

Notify Subscribers

Update Inventory

Send Order Confirmation

Create Shipping Label

Page 36: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

36Event-Driven Architecture in the Cloud@ChadGreen

ScenarioDemonstration

UI

API Gateway

Place Order

Order Processing

Place Order

Payment Processing

Charge Credit Card

Event Hub

Inventory Management

Notifications

Fulfilment

Notify Subscribers

Update Inventory

Send Order Confirmation

Create Shipping Label

Page 37: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

37Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture in the CloudSummary

Page 38: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

38Event-Driven Architecture in the Cloud@ChadGreen

Event-Driven Architecture

Event-driven architecture (EDA) is a design paradigm in which a software component executes in response to receiving one or more event

notifications. EDA is more loosely coupled than the client/server paradigm because the component that sends the notification doesn’t know the identity

of the receiving components at the time of compiling.

- Gartner -

Page 39: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

39Event-Driven Architecture in the Cloud@ChadGreen

Strengths• Decoupling• Encapsulation• Responsive• Scalable /

Distributed• Independence

Weaknesses• Steep Learning

Curve• Complexity• Loss of

Transactionality• Lineage

Opportunities• Multiple

Subsystems• Real-Time

Processing• Complex Event

Processing• High Volume /

Velocity Data

Threats• No Guaranteed

Delivery• Potential

Sequencing Issues

Page 40: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

40Event-Driven Architecture in the Cloud@ChadGreen

Event Producer Event Ingestion Event Consumer

Event Consumer

Event Consumer

Event-Driven ArchitectureSummary

Page 41: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

41Event-Driven Architecture in the Cloud@ChadGreen

Fully managed, real-time data ingestion service that is

simple, trusted, and scalable.

Azure Event HubsSummary

Simple Secure Scalable Open

Page 42: Event-Driven Architecture in the Cloud · Event-Driven Architecture in the Cloud 14 Microservices Enterprise Architecture UI API Gateway Order Processing Payment Processing Inventory

42Event-Driven Architecture in the Cloud@ChadGreen

u)

2

#

[email protected]

Chad GreenDirector of Software DevelopmentScholarRx

chadwickegreenChadGreenChadGreen.com