SlideShare a Scribd company logo
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Decoupled microservices
Building scalable applications
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Agenda (45 min)
Introduction
Application integration patterns
Concrete use cases: Our labs today
Choose your own adventure: Work on your most relevant labs
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Introduction
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
If your application is cloud-native,
large scale, or distributed, and it
doesn’t include a messaging
component, that’s probably a bug.
Tim Bray
formerly AWS Messaging, Workflow Management
4
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Potential drawbacks of
synchronous systems
• Synchronous systems are tightly
coupled
• A problem in a synchronous
downstream dependency has
immediate impact on upstream callers
• Retries from upstream callers can
all too easily fan out and amplify
problems
Photo: Dirk Fröhner
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message exchange
One way Request-response
Message
channel
Receiver
• No response expected
Synchronous vs. fire-and-forget
• Response expected
Return address
Correlation ID
Sender
Message
channel
Responder
Requester
Message
channel
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message channels
Point-to-point (queue) Publish-subscribe (topic)
• Consumed by one receiver
• Easy to scale
• Flatten peak loads
• Consumed by all subscribers
• Durable subscriber
Receivers
Sender
Queue
C
C
Subscribers
Publisher
Topic
C C
C
C
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message channels
Point-to-point (queue) Publish-subscribe (topic)
AWS service for queue functionality:
• Amazon Simple Queue Services (Amazon SQS)
• Serverless & cloud-native
AWS service for topic functionality:
• Amazon Simple Notification Service (Amazon SNS)
• Serverless & cloud-native
Receivers
Publisher
Amazon SQS Amazon SNS
C
C
Sender
Subscribers
C
C
C
C
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message channels
Point-to-point (queue) Publish-subscribe (topic)
AWS service for queue functionality (nonserverless):
• Amazon MQ (managed Apache Active MQ)
• For applications constrained to protocols like JMS, AMQP,
etc.
AWS service for topic functionality (nonserverless):
• Amazon MQ (managed Apache Active MQ)
• For applications constrained to protocols like JMS, AMQP,
etc.
Receivers
Sender
Subscribers
Publisher
Amazon MQ Amazon MQ
C
C C
C
C
C
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message channels
Topic-queue-chaining
• Allows fan-out and receiver scale-out at the same time
Publisher
Topic
Queue
Queue
Receivers
Application 1
Application 2
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message routing
Message filter Recipient list
• Receive only a relevant subset of messages
• Controlled by subscriber
• Publisher remains completely unaware
• Send only a relevant subset of messages to a subscriber
• Controlled by publisher or separate component
• Potentially adds coupling
Subscribers
Publisher
Subscribers
Publisher
Topic
color = blue
color =
yellow
Recipient
list
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message routing
Scatter-gather
Requester
Topic
Responders
Queue
Aggregato
r
Processor
How to distribute a request across potentially interested or relevant parties and capture their individual responses?
• RFQ scenarios, or search for best response
• Parallel processing scenarios; for example, divide and conquer
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message routing
Pipes and filters
• Event triggers chain of processing steps (“filters”)
• Knowledge of destination for next steps is wired into each filter
• Similar patterns: Chain of responsibility, processing pipeline, saga choreography
Event
source
Pipe Filter Filter
Pipe Pipe Result target
…
Filter
Step 1 Step 2 Step n
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message routing
Saga orchestration
• Event triggers orchestrated workflow
• Knowledge of workflow is externalized into orchestrator component, as well as for potential rollback
• Workflow participants remain as loosely coupled as possible
Processor
Processor
Processor
Processor
Event
source
Orchestrator
…
Step 1
Step 2 Step n-1
Step n
Result
target
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Message routing
Saga orchestration
• AWS Step Functions for Serverless Saga orchestration
Processor
Processor
Processor
Processor
Event
source
Orchestrator
…
Step 1
Step 2 Step n-1
Step n
Result
target
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Concrete use cases
labs for today
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Context: Wild Rydes, Inc.
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Choose your path
• We have four labs for you today, plus a
common foundation lab
• After intro of use cases, context, and
patterns, you can pick the most relevant
labs for you
• We will summarize the labs again for you
afterwards
Photo: Dirk Fröhner
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Choose your path
Photo: Dirk Fröhner
Foundation
Lab 0
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Choose your path
Photo: Dirk Fröhner
Foundation
Lab 0
Lab 1
Fan-out,
Message-filtering
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Choose your path
Photo: Dirk Fröhner
Foundation
Lab 0
Lab 1
Fan-out,
Message-filtering
Lab 2
Topic-queue-chaining,
Queues as buffering LBs
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Choose your path
Photo: Dirk Fröhner
Foundation
Lab 0
Lab 1
Fan-out,
Message-filtering
Lab 2
Topic-queue-chaining,
Queues as buffering LBs
Lab 3
Scatter-gather
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Choose your path
Foundation
Lab 0
Lab 1
Fan-out,
Message-filtering
Lab 2
Topic-queue-chaining,
Queues as buffering LBs
Photo: Dirk Fröhner
Lab 3
Scatter-gather
Lab 4
Saga orchestration
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a
for labs 1 + 2
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Interested in rides with
fare >= x
distance >= y
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Integration via database?
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Integration via database?
Oh my!
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Integration via REST APIs?
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Integration via REST APIs?
Absolutely, but…
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
https://...
https://...
https://...
https://...
https://...
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
R E C I P I E N T L I S T S E R V I C E
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
https://...
https://...
https://...
https://...
https://...
Request
distribution
service
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
S E L F - M A N A G E D F I L T E R I N G
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
https://...
https://...
https://...
https://...
https://...
Request
distribution
service
Interested in rides with
fare >= x
distance >= y
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
https://...
https://...
https://...
https://...
https://...
Request
distribution
service
Integration via messaging?
Absolutely!
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
P U B L I S H - S U B S C R I B E ( T O P I C )
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Ride
completion
topic
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
M E S S A G E F I L T E R
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Ride
completion
topic
SNS message filter:
fare >= x
distance >= y
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
M E S S A G E F I L T E R
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Ride
completion
topic
SNS message filter:
fare >= x
distance >= y
Lab 1
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
T O P I C - Q U E U E - C H A I N I N G
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Ride
completion
topic
Lab 2
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case:
for lab 3
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Unicorn management service
Use case: Instant ride RFQ
S C A T T E R - G A T H E R
AWS Cloud
Unicorn
management
resource
{
"from": "...",
"to": "...",
"customer": "..."
}
POST / submit-instant-ride-rfq
202 Accepted
Location: ...
Content-Location: ...
{
"links": { ... },
"status": "...",
"eta": "..."
}
Unicorn
management
resource
Unicorn
management
resource
Request for
quotes topic
Ride booking
service
…
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Unicorn management service
Use case: Instant ride RFQ
S C A T T E R - G A T H E R
AWS Cloud
Unicorn
management
resource
GET / retrieve-rfq-status
Unicorn
management
resource
Unicorn
management
resource
…
Request for
quotes topic
Ride booking
service
RFQ response
queue
Wild Rydes
unicorn app
200 OK
{
"links": { ... },
"status":
"running",
"eta": "..."
}
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Unicorn management service
Use case: Instant ride RFQ
S C A T T E R - G A T H E R
AWS Cloud
Unicorn
management
resource
GET / retrieve-rfq-status
Unicorn
management
resource
Unicorn
management
resource
…
Request for
quotes topic
Ride booking
service
RFQ response
queue
Wild Rydes
unicorn app
200 OK
{
"links": { ...
<link-to-
result>
... },
"status": "done"
}
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Unicorn management service
Use case: Instant ride RFQ
S C A T T E R - G A T H E R
AWS Cloud
Unicorn
management
resource
GET / retrieve-rfq-result
Unicorn
management
resource
Unicorn
management
resource
…
Request for
quotes topic
Ride booking
service
RFQ response
queue
Wild Rydes
unicorn app
200 OK
{
"links": { ... },
"from": "...",
"to": "...",
"quotes": "..."
}
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Fare
for lab 4
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Ride
completion
topic
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
AWS Cloud
Customer
notification
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
POST /submit-ride-completion
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Rides store
Unicorn
management
service
Ride
completion
topic
Wild Rydes
unicorn app
Customer
accounting
service
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Fare collection
S A G A O R C H E S T R A T I O N
1. Credit card pre-authorization
Payment
service
Payment
gateway API
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Fare collection
S A G A O R C H E S T R A T I O N
1. Credit card pre-authorization
2. Charge card using pre-authorization code
Payment
service
Payment
gateway API
Payment
service
Payment
gateway API
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Fare collection
S A G A O R C H E S T R A T I O N
1. Credit card pre-authorization
2. Charge card using pre-authorization code
3. Update customer account
Customer
accounting service
Accounting
system
Payment
service
Payment
gateway API
Payment
service
Payment
gateway API
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Fare collection
S A G A O R C H E S T R A T I O N
1. Credit card pre-authorization
2. Charge card using pre-authorization code
3. Update customer account
To be treated as one distributed TA, to leave the systems in a
semantically consistent state
Customer
accounting service
Accounting
system
Payment
service
Payment
gateway API
Payment
service
Payment
gateway API
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
L A B 1 A R C H I T E C T U R E : F A N - O U T , M E S S A G E F I L T E R I N G
AWS Cloud
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
SNS message filter:
fare >= x
distance >= y
Ride
completion
topic
Rides
store
Unicorn
management
service
https://...
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Submit a ride completion
L A B 2 A R C H I T E C T U R E : T O P I C - Q U E U E - C H A I N I N G , Q U E U E S A S B U F F E R I N G L O A D B A L A N C E R S
AWS Cloud
SNS message filter:
fare >= x
distance >= y
Customer
notification
service
Customer
accounting
service
Customer
loyalty
service
Data lake
ingestion
service
Extraordinary
rides
service
Ride
completion
topic
Rides
store
Unicorn
management
service
{
"from": "...",
"to": "...",
"duration": "...",
"distance": "...",
"customer": "...",
"fare": "..."
}
201 Created
Location: ...
Content-Location: ...
{
<cmpl-ride-repr>
}
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Unicorn management service
Use case: Instant ride RFQ
L A B 3 A R C H I T E C T U R E : S C A T T E R - G A T H E R
AWS Cloud
Unicorn
management
resource
Unicorn
management
resource
Unicorn
management
resource
…
Request for
quotes topic
Ride booking
service
RFQ response
queue
Wild Rydes
unicorn app
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Use case: Fare collection
L A B 4 A R C H I T E C T U R E : S A G A O R C H E S T R A T I O N
1. Credit card pre-authorization
2. Charge card using pre-authorization code
3. Update customer account
To be treated as one distributed TA, to leave the systems in a
semantically consistent state
Customer
accounting service
Accounting
system
Payment
service
Payment
gateway API
Payment
service
Payment
gateway API
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Lab 0 / overview
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Your for today:
https://dashboard.eventengine.run
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Now, choose your own adventure
https://async-messaging.workshop.aws
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
call to
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Resources & call to action
AWS blogs and other content on messaging and application integration
• https://aws.amazon.com/messaging/
• https://aws.amazon.com/event-driven-architecture/
• https://aws.amazon.com/blogs/compute/category/messaging/
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Resources & call to action
AWS blogs and other content on messaging and application integration
• https://aws.amazon.com/messaging/
• https://aws.amazon.com/event-driven-architecture/
• https://aws.amazon.com/blogs/compute/category/messaging/
AWS workshops on messaging and application integration
• https://async-messaging.workshop.aws/
• http://mqworkshop.com/
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Resources & call to action
AWS blogs and other content on messaging and application integration
• https://aws.amazon.com/messaging/
• https://aws.amazon.com/event-driven-architecture/
• https://aws.amazon.com/blogs/compute/category/messaging/
AWS workshops on messaging and application integration
• https://async-messaging.workshop.aws/
• http://mqworkshop.com/
Keep in mind, loose coupling is better than lousy coupling
DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS
© 2022, Amazon Web Services, Inc. or its affiliates.
Thank you!
© 2022, Amazon Web Services, Inc. or its affiliates.

More Related Content

PDF
Application Integration Patterns (not only) for Microservices
PDF
Message-Driven Architecture on AWS
PPTX
Innovate - Breaking Down The Monolith
PDF
Plataforma distribuída de Microserviços ou, como a Olist funciona
PPTX
Keynote Gregor Hohpe - Serverless Architectures
PPTX
5 incredible (and uncommon) serverless patterns
PDF
GreatLearning Webinar - Microservices and Event-Driven Architecture.pdf
PDF
Building Serverless Microservices with AWS
Application Integration Patterns (not only) for Microservices
Message-Driven Architecture on AWS
Innovate - Breaking Down The Monolith
Plataforma distribuída de Microserviços ou, como a Olist funciona
Keynote Gregor Hohpe - Serverless Architectures
5 incredible (and uncommon) serverless patterns
GreatLearning Webinar - Microservices and Event-Driven Architecture.pdf
Building Serverless Microservices with AWS

Similar to Decoupled microservices-Building scalable applications.pptx (20)

PDF
Serverless applications with AWS
PDF
AWS Services - Part 1
POTX
Serverless: State of The Union I AWS Dev Day 2018
PDF
마이크로 서비스 아키텍처와 앱 모던화 – 김일호 :: AWS Builders Online Series
PDF
Messaging
PPTX
Messaging
PDF
2016-06 - Design your api management strategy - AWS - Microservices on AWS
PPTX
SOA Doing Right
PPTX
Microservices: Yes or not?
PPTX
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx
PPTX
NServiceBus - introduction to a message based distributed architecture
PDF
Wildrydes Serverless Workshop Tel Aviv
PDF
Olist Architecture v2.0
PDF
2019 03-13-implementing microservices by ddd
PPTX
Inovação Rápida: O caso de negócio para desenvolvimento de aplicações modernas.
PDF
How we scaled to 80K users by doing nothing!.pdf
PDF
Scalable Web Apps - Journey Through the Cloud
PPTX
Lecture- Loosely Coupled Cloud Native Architectures-- (1).pptx
PDF
SAI - Serverless Integration Architectures - 09/2019
PDF
Building Event-driven Architectures with Amazon EventBridge
Serverless applications with AWS
AWS Services - Part 1
Serverless: State of The Union I AWS Dev Day 2018
마이크로 서비스 아키텍처와 앱 모던화 – 김일호 :: AWS Builders Online Series
Messaging
Messaging
2016-06 - Design your api management strategy - AWS - Microservices on AWS
SOA Doing Right
Microservices: Yes or not?
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx
NServiceBus - introduction to a message based distributed architecture
Wildrydes Serverless Workshop Tel Aviv
Olist Architecture v2.0
2019 03-13-implementing microservices by ddd
Inovação Rápida: O caso de negócio para desenvolvimento de aplicações modernas.
How we scaled to 80K users by doing nothing!.pdf
Scalable Web Apps - Journey Through the Cloud
Lecture- Loosely Coupled Cloud Native Architectures-- (1).pptx
SAI - Serverless Integration Architectures - 09/2019
Building Event-driven Architectures with Amazon EventBridge
Ad

Recently uploaded (20)

PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
Topaz Photo AI Crack New Download (Latest 2025)
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PPTX
assetexplorer- product-overview - presentation
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
Complete Guide to Website Development in Malaysia for SMEs
PPTX
chapter 5 systemdesign2008.pptx for cimputer science students
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
iTop VPN Crack Latest Version Full Key 2025
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Topaz Photo AI Crack New Download (Latest 2025)
How to Use SharePoint as an ISO-Compliant Document Management System
Advanced SystemCare Ultimate Crack + Portable (2025)
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Tech Workshop Escape Room Tech Workshop
Weekly report ppt - harsh dattuprasad patel.pptx
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Wondershare Recoverit Full Crack New Version (Latest 2025)
Digital Systems & Binary Numbers (comprehensive )
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
assetexplorer- product-overview - presentation
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Patient Appointment Booking in Odoo with online payment
Complete Guide to Website Development in Malaysia for SMEs
chapter 5 systemdesign2008.pptx for cimputer science students
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
iTop VPN Crack Latest Version Full Key 2025
Ad

Decoupled microservices-Building scalable applications.pptx

  • 1. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Decoupled microservices Building scalable applications
  • 2. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Agenda (45 min) Introduction Application integration patterns Concrete use cases: Our labs today Choose your own adventure: Work on your most relevant labs
  • 3. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Introduction
  • 4. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. If your application is cloud-native, large scale, or distributed, and it doesn’t include a messaging component, that’s probably a bug. Tim Bray formerly AWS Messaging, Workflow Management 4
  • 5. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Potential drawbacks of synchronous systems • Synchronous systems are tightly coupled • A problem in a synchronous downstream dependency has immediate impact on upstream callers • Retries from upstream callers can all too easily fan out and amplify problems Photo: Dirk Fröhner
  • 6. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates.
  • 7. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message exchange One way Request-response Message channel Receiver • No response expected Synchronous vs. fire-and-forget • Response expected Return address Correlation ID Sender Message channel Responder Requester Message channel
  • 8. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message channels Point-to-point (queue) Publish-subscribe (topic) • Consumed by one receiver • Easy to scale • Flatten peak loads • Consumed by all subscribers • Durable subscriber Receivers Sender Queue C C Subscribers Publisher Topic C C C C
  • 9. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message channels Point-to-point (queue) Publish-subscribe (topic) AWS service for queue functionality: • Amazon Simple Queue Services (Amazon SQS) • Serverless & cloud-native AWS service for topic functionality: • Amazon Simple Notification Service (Amazon SNS) • Serverless & cloud-native Receivers Publisher Amazon SQS Amazon SNS C C Sender Subscribers C C C C
  • 10. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message channels Point-to-point (queue) Publish-subscribe (topic) AWS service for queue functionality (nonserverless): • Amazon MQ (managed Apache Active MQ) • For applications constrained to protocols like JMS, AMQP, etc. AWS service for topic functionality (nonserverless): • Amazon MQ (managed Apache Active MQ) • For applications constrained to protocols like JMS, AMQP, etc. Receivers Sender Subscribers Publisher Amazon MQ Amazon MQ C C C C C C
  • 11. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message channels Topic-queue-chaining • Allows fan-out and receiver scale-out at the same time Publisher Topic Queue Queue Receivers Application 1 Application 2
  • 12. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message routing Message filter Recipient list • Receive only a relevant subset of messages • Controlled by subscriber • Publisher remains completely unaware • Send only a relevant subset of messages to a subscriber • Controlled by publisher or separate component • Potentially adds coupling Subscribers Publisher Subscribers Publisher Topic color = blue color = yellow Recipient list
  • 13. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message routing Scatter-gather Requester Topic Responders Queue Aggregato r Processor How to distribute a request across potentially interested or relevant parties and capture their individual responses? • RFQ scenarios, or search for best response • Parallel processing scenarios; for example, divide and conquer
  • 14. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message routing Pipes and filters • Event triggers chain of processing steps (“filters”) • Knowledge of destination for next steps is wired into each filter • Similar patterns: Chain of responsibility, processing pipeline, saga choreography Event source Pipe Filter Filter Pipe Pipe Result target … Filter Step 1 Step 2 Step n
  • 15. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message routing Saga orchestration • Event triggers orchestrated workflow • Knowledge of workflow is externalized into orchestrator component, as well as for potential rollback • Workflow participants remain as loosely coupled as possible Processor Processor Processor Processor Event source Orchestrator … Step 1 Step 2 Step n-1 Step n Result target
  • 16. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Message routing Saga orchestration • AWS Step Functions for Serverless Saga orchestration Processor Processor Processor Processor Event source Orchestrator … Step 1 Step 2 Step n-1 Step n Result target
  • 17. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Concrete use cases labs for today
  • 18. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Context: Wild Rydes, Inc.
  • 19. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Choose your path • We have four labs for you today, plus a common foundation lab • After intro of use cases, context, and patterns, you can pick the most relevant labs for you • We will summarize the labs again for you afterwards Photo: Dirk Fröhner
  • 20. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Choose your path Photo: Dirk Fröhner Foundation Lab 0
  • 21. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Choose your path Photo: Dirk Fröhner Foundation Lab 0 Lab 1 Fan-out, Message-filtering
  • 22. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Choose your path Photo: Dirk Fröhner Foundation Lab 0 Lab 1 Fan-out, Message-filtering Lab 2 Topic-queue-chaining, Queues as buffering LBs
  • 23. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Choose your path Photo: Dirk Fröhner Foundation Lab 0 Lab 1 Fan-out, Message-filtering Lab 2 Topic-queue-chaining, Queues as buffering LBs Lab 3 Scatter-gather
  • 24. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Choose your path Foundation Lab 0 Lab 1 Fan-out, Message-filtering Lab 2 Topic-queue-chaining, Queues as buffering LBs Photo: Dirk Fröhner Lab 3 Scatter-gather Lab 4 Saga orchestration
  • 25. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a for labs 1 + 2
  • 26. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Wild Rydes unicorn app
  • 27. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Interested in rides with fare >= x distance >= y Wild Rydes unicorn app
  • 28. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Integration via database? Wild Rydes unicorn app
  • 29. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Integration via database? Oh my! Wild Rydes unicorn app
  • 30. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Integration via REST APIs? Wild Rydes unicorn app
  • 31. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Integration via REST APIs? Absolutely, but… Wild Rydes unicorn app
  • 32. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service https://... https://... https://... https://... https://... Wild Rydes unicorn app
  • 33. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion R E C I P I E N T L I S T S E R V I C E AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service https://... https://... https://... https://... https://... Request distribution service Wild Rydes unicorn app
  • 34. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion S E L F - M A N A G E D F I L T E R I N G AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service https://... https://... https://... https://... https://... Request distribution service Interested in rides with fare >= x distance >= y Wild Rydes unicorn app
  • 35. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service https://... https://... https://... https://... https://... Request distribution service Integration via messaging? Absolutely! Wild Rydes unicorn app
  • 36. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion P U B L I S H - S U B S C R I B E ( T O P I C ) AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Ride completion topic Wild Rydes unicorn app
  • 37. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion M E S S A G E F I L T E R AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Ride completion topic SNS message filter: fare >= x distance >= y Wild Rydes unicorn app
  • 38. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion M E S S A G E F I L T E R AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Ride completion topic SNS message filter: fare >= x distance >= y Lab 1 Wild Rydes unicorn app
  • 39. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion T O P I C - Q U E U E - C H A I N I N G AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Ride completion topic Lab 2 Wild Rydes unicorn app
  • 40. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Use case: for lab 3
  • 41. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Unicorn management service Use case: Instant ride RFQ S C A T T E R - G A T H E R AWS Cloud Unicorn management resource { "from": "...", "to": "...", "customer": "..." } POST / submit-instant-ride-rfq 202 Accepted Location: ... Content-Location: ... { "links": { ... }, "status": "...", "eta": "..." } Unicorn management resource Unicorn management resource Request for quotes topic Ride booking service … Wild Rydes unicorn app
  • 42. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Unicorn management service Use case: Instant ride RFQ S C A T T E R - G A T H E R AWS Cloud Unicorn management resource GET / retrieve-rfq-status Unicorn management resource Unicorn management resource … Request for quotes topic Ride booking service RFQ response queue Wild Rydes unicorn app 200 OK { "links": { ... }, "status": "running", "eta": "..." }
  • 43. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Unicorn management service Use case: Instant ride RFQ S C A T T E R - G A T H E R AWS Cloud Unicorn management resource GET / retrieve-rfq-status Unicorn management resource Unicorn management resource … Request for quotes topic Ride booking service RFQ response queue Wild Rydes unicorn app 200 OK { "links": { ... <link-to- result> ... }, "status": "done" }
  • 44. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Unicorn management service Use case: Instant ride RFQ S C A T T E R - G A T H E R AWS Cloud Unicorn management resource GET / retrieve-rfq-result Unicorn management resource Unicorn management resource … Request for quotes topic Ride booking service RFQ response queue Wild Rydes unicorn app 200 OK { "links": { ... }, "from": "...", "to": "...", "quotes": "..." }
  • 45. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Fare for lab 4
  • 46. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Ride completion topic Wild Rydes unicorn app
  • 47. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion AWS Cloud Customer notification service Customer loyalty service Data lake ingestion service Extraordinary rides service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } POST /submit-ride-completion 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Rides store Unicorn management service Ride completion topic Wild Rydes unicorn app Customer accounting service
  • 48. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Fare collection S A G A O R C H E S T R A T I O N 1. Credit card pre-authorization Payment service Payment gateway API
  • 49. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Fare collection S A G A O R C H E S T R A T I O N 1. Credit card pre-authorization 2. Charge card using pre-authorization code Payment service Payment gateway API Payment service Payment gateway API
  • 50. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Fare collection S A G A O R C H E S T R A T I O N 1. Credit card pre-authorization 2. Charge card using pre-authorization code 3. Update customer account Customer accounting service Accounting system Payment service Payment gateway API Payment service Payment gateway API
  • 51. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Fare collection S A G A O R C H E S T R A T I O N 1. Credit card pre-authorization 2. Charge card using pre-authorization code 3. Update customer account To be treated as one distributed TA, to leave the systems in a semantically consistent state Customer accounting service Accounting system Payment service Payment gateway API Payment service Payment gateway API
  • 52. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates.
  • 53. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion L A B 1 A R C H I T E C T U R E : F A N - O U T , M E S S A G E F I L T E R I N G AWS Cloud Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service SNS message filter: fare >= x distance >= y Ride completion topic Rides store Unicorn management service https://... { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Wild Rydes unicorn app
  • 54. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Submit a ride completion L A B 2 A R C H I T E C T U R E : T O P I C - Q U E U E - C H A I N I N G , Q U E U E S A S B U F F E R I N G L O A D B A L A N C E R S AWS Cloud SNS message filter: fare >= x distance >= y Customer notification service Customer accounting service Customer loyalty service Data lake ingestion service Extraordinary rides service Ride completion topic Rides store Unicorn management service { "from": "...", "to": "...", "duration": "...", "distance": "...", "customer": "...", "fare": "..." } 201 Created Location: ... Content-Location: ... { <cmpl-ride-repr> } Wild Rydes unicorn app
  • 55. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Unicorn management service Use case: Instant ride RFQ L A B 3 A R C H I T E C T U R E : S C A T T E R - G A T H E R AWS Cloud Unicorn management resource Unicorn management resource Unicorn management resource … Request for quotes topic Ride booking service RFQ response queue Wild Rydes unicorn app
  • 56. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Use case: Fare collection L A B 4 A R C H I T E C T U R E : S A G A O R C H E S T R A T I O N 1. Credit card pre-authorization 2. Charge card using pre-authorization code 3. Update customer account To be treated as one distributed TA, to leave the systems in a semantically consistent state Customer accounting service Accounting system Payment service Payment gateway API Payment service Payment gateway API
  • 57. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Lab 0 / overview
  • 58. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Your for today: https://dashboard.eventengine.run
  • 59. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Now, choose your own adventure https://async-messaging.workshop.aws
  • 60. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. call to
  • 61. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Resources & call to action AWS blogs and other content on messaging and application integration • https://aws.amazon.com/messaging/ • https://aws.amazon.com/event-driven-architecture/ • https://aws.amazon.com/blogs/compute/category/messaging/
  • 62. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Resources & call to action AWS blogs and other content on messaging and application integration • https://aws.amazon.com/messaging/ • https://aws.amazon.com/event-driven-architecture/ • https://aws.amazon.com/blogs/compute/category/messaging/ AWS workshops on messaging and application integration • https://async-messaging.workshop.aws/ • http://mqworkshop.com/
  • 63. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Resources & call to action AWS blogs and other content on messaging and application integration • https://aws.amazon.com/messaging/ • https://aws.amazon.com/event-driven-architecture/ • https://aws.amazon.com/blogs/compute/category/messaging/ AWS workshops on messaging and application integration • https://async-messaging.workshop.aws/ • http://mqworkshop.com/ Keep in mind, loose coupling is better than lousy coupling
  • 64. DECOUPLED MICROSERVICES: BUILDING SCALABLE APPLICATIONS © 2022, Amazon Web Services, Inc. or its affiliates. Thank you! © 2022, Amazon Web Services, Inc. or its affiliates.

Editor's Notes

  • #55: And also remember that DLQs can enrich this architecture (leaving it out to keep the diagram digestible).
  • #61: CTA: Lake Formation, web day talk, blogs. Link to AWS P&U landing page. AWS big data landing page, data lakes and analytics on AWS.