GreatLearning Webinar - Microservices and Event-Driven Architecture.pdf
dhavaln
62 views
33 slides
Jul 24, 2024
Slide 1 of 33
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
About This Presentation
This presentation was created for a cohort of Cloud Computing batch in GreatLearning. The presentation showcases how to build Microservices and Event-Driven Architecture on AWS platform
Size: 1.02 MB
Language: en
Added: Jul 24, 2024
Slides: 33 pages
Slide Content
Microservices and Event-Driven
Architecture on AWS
Dhaval Nagar
12x AWS Certified, AWS Serverless Hero
●12x AWS, 2x GCP, Kubernetes, Docker Certified
●AWS Serverless Hero - 2020
●AWS Certification Subject Matter Expert (SME)
●AWS User Group Leader, Surat
●Founder - AppGambit (AWS Consulting Partner)
Agenda
●Introduction to Event-Driven Microservices
●AWS Services
●Demo (3 Demo Services)
●Q / A
●Summary
The microservice architectural style is an approach to developing a single
application as a suite of small services, each running in its own process
and communicating with lightweight mechanisms, often an HTTP resource
API.
Characteristics of a Microservice
What is Monolithic Application
●The whole application is built as a single unit
●Often divided in three main parts
○Client-side application (consisting of HTML pages and javascript running in a browser)
○Server-side Application (Business or Controller Layer)
○Data (Database) Layer (consisting of many tables inserted into a common, and usually
relational, database management system)
●The server-side application will handle HTTP requests, execute domain
logic, retrieve and update data from the database, and select and
populate HTML views to be sent to the browser.
●This server-side application is a monolith - a single logical executable.
●Any changes to the system involve building and deploying a new version
of the server-side application.
What is the use case for Micro-services
●Monolithic application are not necessarily BAD
●It largely depends on the kind of the application, team size and number of
other factors like Performance and Scaling
●If you have just one application, your whole team is making code changes
in that
●Test cycles can be longer
●Scaling will have to consider the whole application, even though there are
only a few parts that requires more processing power
Monolithic vs Microservice Architecture
https://martinfowler.com/articles/microservices.html
Microservices != Containers (Docker)
●Containers is a (Packaging and) Delivery Mechanism
●Microservice is an Architectural Pattern
12 Factor App - Software As a Service
●Codebase in Version control
●Explicitly declare Dependencies
●Store configurations in environment
●Backing services as attached
resource
●Build, Release, Run
●Stateless processes
https://12factor.net/
●Export services via Port Binding
●Scale out via the process model
●Scale fast and shrink gracefully
●Keep Dev, Staging, and Production
environment similar
●Treat logs as Event stream
●Run admin processes separately
Microservices and AWS
●Compute
●Storage
●Database
●Networking and Service Discovery
●Messaging
●Logging and Monitoring
●Developer Tools
Half of new apps built inside of Amazon this year are
using Lambda!
@ re:Invent 2020, Andy Jassy, ex-CEO, AWS
https://aws.amazon.com/blogs/aws/reinvent-2020-liveblog-andy-jassy-keynote/
●Upload functions and attach Triggers
●When Trigger runs, Lambda Service executes the Function
●You can run thousands of functions in parallel
Why Use Serverless!!
●No Server Management
●Flexible Scaling
●Highly Available
●Pay for Consumption
●Secure Environment
Lambda Service - Event-Driven Compute
Serverless Web Application
Web App is hosted on S3 APIs managed with API Gateway Data stored on
DynamoDB
How Lambda (Serverless) Works!
Synchronous Communication
Asynchronous Communication
Serverless Microservice Patterns at AWS
Simple API Request
https://www.jeremydaly.com/serverless-microservice-patterns-for-aws/
Scalable Webhook Request
Strangler Pattern - Route requests to Old and New
Applications
Demo #2 - Process Data Files on S3 Asynchronously
https://github.com/AppGambitStudio/GreatLearning-Serverless-Demos
Demo #3 - Process Data updated in MongoDB Atlas
https://github.com/AppGambitStudio/GreatLearning-Serverless-Demos
When to (Not) Use
●Strong module boundaries - Focus
on business features
●Independent Deployment - Adhere
to DevOps practice
●Technology Diversity - Polyglot
Tech Stack
●Distribution - Everything is
distributed
●Eventual Consistency - Everything
is distributed (again)
●Operational Complexities -
Monitoring distributed resources
are hard
Summary
●Almost every popular service that you know uses Microservice pattern
●Reusability across business
●Adds resiliency into the whole application
●Simple to Deploy
●Easy to Scale
●It’s not a silver bullet - may not be required in every use case
Summary
Q / A
References
●Serverless Framework - http://serverless.com/
●AWS Serverless Application Model - https://aws.amazon.com/serverless/sam/
●AWS Event Driven Architecture -
https://aws.amazon.com/event-driven-architecture/
●Serverless on AWS - https://aws.amazon.com/serverless/
●Serverless Blogs - https://serverlessland.com/
●Serverless Framework vs SAM -
https://www.serverless.com/learn/comparisons/