23. Sensitivity: Secret
• Event producer is agnostic of the consumers
• Producer adds its origin identity Domain, service, function
• Producer conforms to a contract & structure
Think as API
• Packs just-the-required data
Least data privilege
• Producer adds a unique event identifier Think traceability
25. • Consumer deals with event duplicates Remember idempotency?
• Stores events before processing Storage-first pattern
• Ordering of events not guaranteed
Well, the world is asynchronous!
• Don’t modify & relay events Respect authenticity
27. Sensitivity: Secret
Prove yourself that serverless works!
Convince your colleagues that serverless is fun!
Satisfy your stakeholders that serverless is good!
28. Sensitivity: Secret
Tangled event-drivenarchitecture
Lambda pinball architecture
Lambda pinball architectures characteristically
lose sight of important domain logic in the
tangled web of lambdas, buckets and queues as
requests bounce around increasingly complex
graphs of cloud services.
Thoughtworks
33. Sensitivity: Secret
Amazon EventBridge is a serverless event bus service that
makes it easy to connect your applications with data from a
variety of sources
34. Sensitivity: Secret
Amazon EventBridge
Custom event bus
Default event bus
Partner event bus
Event producers
(sources)
Event consumers
(targets)
Partner apps
Custom apps
AWS services
Event bus Filtering &
routing rules
37. Sensitivity: Secret
There are only patterns, patterns on top of patterns, patterns
that affect other patterns. Patterns hidden by patterns.
Patterns within patterns.
Chuck Palahniuk
42. Sensitivity: Secret
Hub-and-spokeeventbus
Customer
login
Login Shipping
Send order
to SAP
Data sync
Customer, VIP,
wishlist sync
Checkout
Submit
order
Payment
Authorize
payment
Commerce
platform
Order
Process
order
Order and
customer
updates
Event
relay
Customer
login
Invoke
every
minute
Events Order
complete
Customer
login
Payment
authorized
Order
submit
Order
complete
EventBridge
FIFO
queue
43. Sensitivity: Secret
Choreography
This Photo by Unknown Author is licensed under CC BY-SA-NC
Event Bus
Publisher Subscriber
Publisher Publisher
Publisher
Subscriber
Subscriber Subscriber
• No conductor
• Pub-sub model
• Service decoupling
• Asynchronous
• Idempotency
• Traceability
Use choreography to coordinate
different microservices
51. Sensitivity: Secret
Loyalty
registration
Joins loyalty program
Retail
customer
Retail POS
device Customer
accounts
Loyalty
Service
Customer
Service
Async registration
Registration process
Loyalty
number
Loyalty
number
UseCase:Customerregistration
Enroll
61. Sensitivity: Secret
Pattern: Circuit-breaker with archive-replay
Order
Processing
Vendor
Mediator
Event bus
SaaS
Platform
Orders Cache
SUCCESS – All good
ERROR – Data
RETRY – Timeout, 5XX
63. Sensitivity: Secret
Vendor
Mediator
Event bus
Order
status events
Order status
consumer rule
Order retry archive
rule
Event
archive
success
error
retry
retry
Events archive
An event archive is a collection of events that
have been published on an event bus.
64. Sensitivity: Secret
An event archive is a collection of events that
have been published on an event bus.
Resources:
VoucherArchive:
Type: AWS::Events::Archive
Properties:
ArchiveName: OrdersArchive
Description: Orders to be resubmitted
EventPattern:
<YourEventFilter>
RetentionDays: 10
SourceArn: 'arn:aws:..:event-bus/loyalty'
{
"detail": {
"metadata": {
"domain": [
"LEGO-LOYALTY"
],
"service": [
“order-submission"
],
"category": [
"task-status"
],
"type": [
“order"
],
"status": [
"retry"
]
}
}
}
65. Sensitivity: Secret
Vendor
Mediator
Event bus
Order
status events
Order status
consumer rule
Order retry archive
rule
Event
archive
success
error
retry
retry
SaaS
Platform
Replay
trigger
Status
Scheduler
API
retry events
retry events
Events replay
68. Sensitivity: Secret
• Flexible retention period
• Multiple archives
• Replay start & end time
• Replay target rule
• Event separation
• Replay event exodus
• Order not maintained
• Take care of idempotency
• No archive visibility
• Replay delay
Archive-Replay–BenefitsvsBeAwareOf
70. Sensitivity: Secret
Choreography
This Photo by Unknown Author is licensed under CC BY-SA-NC
Event Bus
Publisher Subscriber
Publisher Publisher
Publisher
Subscriber
Subscriber Subscriber
• No conductor
• Pub-sub model
• Service decoupling
• Asynchronous
• Idempotency
• Traceability
Use choreography to coordinate
different microservices
73. Sensitivity: Secret
Orchestration
• Orchestrator
• Workflow
• Long running
• Coordination of tasks
• Low code
• Pause & resume
Data
Process
Process Process
“Cross-service orchestration.
Good or bad?” “Logic:
Inside a function or
in a state machine?”
Use orchestration inside
microservices
Use distributed orchestration
across microservices
74. Sensitivity: Secret
Use case: Cross-service task coordination
Data Process
Process
Long running
process
API
Function
Microservice A Microservice B
Microservice C
86. Sensitivity: Secret
Publicclient
Loyalty Service Platform
SaaS
CRM
Data
Feeder
Loyalty
Sessions
Event
Bus
Event Source
Orders
Service
Status
Admin
Rewards
Members
SaaS
Survey
LEGO
Data Lake
NPS
Provider
CRM
Mediator
Fraud Engine
Events
Ingestion
87. Sensitivity: Secret
Publicclient
Loyalty Service Platform
SaaS
CRM
Data
Feeder
Loyalty
Sessions
Event
Bus
Event Source
Orders
Service
Status
Admin
Rewards
Members
SaaS
Survey
LEGO
Data Lake
NPS
Provider
CRM
Mediator
Fraud Engine
Events
Ingestion
88. Sensitivity: Secret
Publicclient
Loyalty Service Platform
SaaS
CRM
Data
Feeder
Loyalty
Sessions
Event
Bus
Event Source
Orders
Service
Status
Admin
Rewards
Members
SaaS
Survey
LEGO
Data Lake
NPS
Provider
CRM
Mediator
Fraud Engine
Events
Ingestion
Domain events
• Businesssignificant
• Outward & inwardflowing
• Restricted access
Operational/internalevents
• Internal visibility
• Messengers& Catalysts
• Available within the boundary
89. Sensitivity: Secret
Publicclient
Loyalty Service Platform
SaaS
CRM
Data
Feeder
Loyalty
Sessions
Event
Bus
Event Source
Orders
Service
Status
Admin
Rewards
Members
SaaS
Survey
LEGO
Data Lake
NPS
Provider
CRM
Mediator
Fraud Engine
Webhook
Domain events
• Businesssignificant
• Outward & inwardflowing
• Restricted access
Operational/internalevents
• Internal visibility
• Messengers& Catalysts
• Available within the boundary
Gatekeeperservicebus
Internal
Event
Bus
Gate
Keeper
Bus
External
subscribers
90. Sensitivity: Secret
Publicclient
Loyalty Service Platform
SaaS
CRM
Data
Feeder
Loyalty
Sessions
Event Source
Orders
Service
Status
Admin
Rewards
Members
SaaS
Survey
LEGO
Data Lake
NPS
Provider
CRM
Mediator
Fraud Engine
Events
Ingestion
Domain events
• Businesssignificant
• Outward & inwardflowing
• Restricted access
Operational/internalevents
• Internal visibility
• Messengers& Catalysts
• Available within the boundary
Gatekeeper
Bus
Internal
Event
Bus
External
Targets
94. Sensitivity: Secret
• Event streamer
• Event size: 1 MB
• Event batching
• Event store: 24hr – 1yr
• Sequence number
• Limited targets
• On-demand & provisioned
o Event choreographer
o Event size: 256 KB
o No event batching
o Event archive
o No sequencing
o Many targets
o On-demand scaling
Kinesis EventBridge
Services-scale refined event
ingestion and routing
Cloud-scale raw event
ingestion and processing