Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Building microservices with event-driven architecture
Donnie PrakosoTechnical Evangelist, AWS
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
1. Moving from monolith to microservices
2. Overview of event-driven architecture
3. Asynchronous messaging in microservices architecture
4. Building a real-time communication application with WebSocket
5. Moving forward: Orchestration and state management
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Building a voting application—with microservices
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MonolithDoes everything
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What do we need?
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservices
Do one
thing wellIndependent
Decentralized
Black box
Polyglot
You build it, you run it
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Overview of event-driven architecture
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless compute engine
for containers
Long-running
Bring existing code
Fully managed orchestration
AWS Fargate
Serverless event-driven
code execution
Short-lived
All language runtimes
Data-source integrations
AWS Lambda
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservice AP
I
AP
I Microservice
MicroserviceE
ve
nt
AP
IMicroservice
Eve
nt
AP
I Microservice
Application
Mobile client
Client
Internet of
Things (IoT)
Persistence Persistence
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Communication is the front door of microservices
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Communication in microservices architecture
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Communication categories
Protocol Receiver(s)
• Synchronous messaging
• ex., HTTP
• Asynchronous messaging
• ex., JMS, MQTT
• Single receiver
• ex., message queue
• Multiple receivers
• ex., Pub/Sub
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Challenge of synchronous messaging
Client
AP
I Microservice A
AP
I Microservice B
AP
I Microservice C
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Synchronous and asynchronous communication
Synchronous
Request-Response
Immediate access to results
You manage:
- Retries
- Ordering
- Error handling
- Blocking and threads
- Timeouts
Asynchronous
Fire (and forget)
Default behavior:
- Retries
- Ordering
- DLQ errors
- Throughput
You manage:
- Error response
- Duplicates
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Decoupling into smaller, independent building blocks using messaging
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Decoupling into smaller, independent building blocks using messaging
Queues
Simple
Fully managed
Any volume
Pub/Sub
Simple
Fully managed
Flexible
Amazon Simple
Queue Service
(Amazon SQS)
Amazon Simple
Notification
Service
(Amazon SNS)
Messaging
Synchronization
Rapid
Fully managed
Real time
Amazon
CloudWatch
Events
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pub/Sub pattern
The publish/subscribe model
allows messages to be
broadcast to different parts of
a system asynchronously.
Amazon SNS message
filteringOffload the message filtering
logic from subscribers and the
message routing logic from
publishers.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo: Pub/Sub
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Building a real-time communication with WebSocket
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WebSocket support for API Gateway
Real-time two-way
communication
applications backed
by AWS Lambda
functions or other
Amazon API
Gateway
integrations
Amazon API Gateway
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo:WebSocket API
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservices implementation
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservices demo: Voting application
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservices demo: Voting application
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Moving forward: Orchestration and state management
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Productivity
Agility
Resilience
Build distributed applications using visual workflows
Order Service
Inventory Service
Invoice Service
Logistic Service
Notification Service
AWS Step Functions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Track status of data
and execution
Remove
redundant code
Build workflows to orchestrate everything
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Increase
customer
value
Build better
products
Innovate
more often
Release
features
faster
Focus on
business
logic
Decouple
software
systems
Automate and abstract away as much as possible so we can focus on building
products for our customers
We are witnessing a paradigm shift
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Learn from AWS experts. Advance your skills and knowledge. Build your future in the AWS Cloud.
Digital Training
Free, self-paced online
courses built by AWS
experts
Classroom Training
Classes taught by accredited
AWS instructors
AWS Certification
Exams to validate expertise
with an industry-recognized
credential
Ready to begin building your cloud skills?
Get started at: https://www.aws.training/
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why work with an APN Partner?
APN Partners are uniquely positioned to help your organization at any stage of your cloud adoption journey, and they:
• Share your goals—focused on your success
• Help you take full advantage of all the business benefits that AWS has to offer
• Provide services and solutions to support any AWS use case across your full customer life cycle
APN Partners with deep expertise in
AWS services:
Find the right APN Partner for your needs: https://aws.amazon.com/partners/find/
AWS Service Delivery Partners
APN Partners with a track record of delivering
specific AWS services to customers
AWS Managed Service Provider (MSP)
Partners
APN Partners with cloud infrastructure and
application migration expertise
AWS Competency Partners
APN Partners with verified, vetted, and validated
specialized offerings
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you for attending AWS Innovate
We hope you found it interesting! A kind reminder to complete the survey.
Let us know what you thought of today’s event and how we can improve the event
experience for you in the future.
twitter.com/AWSCloud
facebook.com/AmazonWebServices
youtube.com/user/AmazonWebServices
slideshare.net/AmazonWebServices
twitch.tv/aws