2022 Presentation | Serverless Innovation with AWS

dhavaln 39 views 30 slides Jul 24, 2024
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

This was part of a group presentation on how to use Serverless Technologies and build Modern Cloud Native solutions on AWS platform.


Slide Content

Serverless
Pace of Innovation
Dhaval Nagar
AWS Hero, AWS Certifications SME
Founder @ AppGambit, AWS Consulting Partner

Serverless has demonstrated that it is the operational
model of the future. Over the past year, we’ve seen 125
percent growth in the number of serverless function
invocations on Vercel, fueled by serverless-oriented
frameworks like Next.js.
Guillermo Rauch, CEO, Vercel

Current State of Serverless
●The original idea was to – Free developers from the infrastructure
planning and management.
●More and more teams are looking to adapt to infrastructure services that
are scalable, having low operational overhead, secure and cost effective in
use.
●While many hardcore use cases may not be suitable for this model, but
large number of usecases are shifting to this new mechanism due to
advanced services like API Gateway, Lambda, Aurora, and DynamoDB
●Many dedicated services now support Serverless model outside of the
mainstream Cloud providers

AWS Lambda is not the ONLY Serverless Service

There are many services that together makes the whole
AWS Serverless Ecosystem
Databases
Compute
REST / GraphQL APIs
Workflow Orchastraction
Communication and Integration

Application Infrastructure Breakdown
●Web Content Delivery
●Authentication / User Management
●APIs
●Business Logic / Microservices
●Internal Communication for Microservices
●Databases
●User Engagement (Email, Push Notifications, etc)
●DevTools, Monitoring and Observability

Web Content Delivery
●Combination of Amazon S3 with CloudFront for the Global Content
Delivery
●Powerful Edge Service for Large-scale distribution including Edge compute
option
●Route53 and AWS Certificate Manager for easy Domain and SSL
management
●Silent benefit is the overall performance and security improvement on the
actual business logic, whether you write containers or functions

●Slack in the early days was just using the direct ALB endpoint
●To improve the global latency they introduced AWS CloudFront in front of
the ALB
●Their primary reason to move is to achieve the SSL termination at the
edge, DDoS mitigation and Low-Latency Global delivery
https://www.youtube.com/watch?v=oVaTiRl9-v0&ab_channel=AmazonWebServices

Authentication
●Programming the User Management features for 10 or 100 users is too
much effort
●But the same for 10,000 or 100,000+ users is pretty hard
●“Signin with Google/Facebook/Twitter” was the original idea to get away
with most of User Management ops and also inherit the security
●Amazon Cognito is still a popular and cheap auth mechnism and well
integrated with other AWS services like API Gateway, ALB and AppSync
(with granular permissions)
●Cognito also remains one of the complicated service to setup and use
https://theburningmonk.com/2021/03/the-case-for-and-against-amazon-cognito/

Web APIs / REST / GraphQL
●APIs are key component for most production systems
●Depending on your choice of language there are pretty standard
frameworks that most developers choose
●For example, ExpressJS with NodeJS and Flash with Python
●API Gateway can manage REST as well as Web Socket for millions of
requests
●One of the most common serverless usage pattern is “API Gateway -> to
-> Lambda Function”

●Taco Bell Engineering team prefers Serverless-First approach - This
requires careful evaluation of the usecase to understand if it can be
solved reliably using Serverless technologies vs other approaches
●Taco Bell build a delivery platform using AWS Serverless services like API
Gateway, EventBridge, Lambda and Step Functions
●They use HTTP API instead of the REST, this is 67% cheaper compared to
REST option
●The system is designed to process 300,000 orders per hour
https://www.youtube.com/watch?v=sezX7CSbXTg

Business Logic / Compute
●Lambda is the most popular Serverless compute option
●Easy to configure, supports various platforms and can be used with
Docker Containers as well
●But due to certain limitations Lambda may not be suitable for all the use
cases
●AWS Fargate is a fully Serverless Container system

●Generates Market Research Data based on the events
●They proess roughly 250 Billion Events Per Day
●They use S3 to receive event data files, EMR to process and then save the
output to S3
●S3 Triggers are used to initiate further processing of the output files
through Lambda functions and SQS
https://www.youtube.com/watch?v=Jkx6kVbDpL4&t=179s

Multiple Platforms
like Python, Node,
Ruby
In-build Retry
Mechanism in case
of failures
Run within VPC
mode for private
execution
Pay by Milliseconds
per Execution
Support for different
CPU architecture
Complex
Orchastration using
Step functions
Code signing for
compliance support
128 Mb to 10 GB RAM
- Tune based on the
usage type
Support for Ephemeral
and Elastic File System
Why Lambda is Favorable among Developers

Instead of Managing the Underlying Infrastructure Instnaces, only provision the
resources required by the Container

Internal Communication for Microservices
●Serverless Architecture is alternatively known as Event-Driven
Architecture
●Each service is receiving an Event to “invoke” certain actiona and “emit” an
Event for the next operation.
●AWS has wide category of services with equally wide featureset to support
complex communication topologies
●SQS, SNS and EventBridge are each designed to compliment each other or
can be used to form a hybrid communication use case
●Besides above there are a number of purpose-built services like Kinesis
Data Strem, S3 Triggers, DynamoDB Stream and Cognito Auth Trigger
●AWS takes the Event-Driven model to next level, almost every service
emits Events that can be “ingested” for processing

SQS Flow
SNS Flow

Can also be integrated to Receive events from external systems like Auth0,
Datadog, MongoDB, Shopify or event Magento.

●Delivering 50M packages with Serverless Tracking Solution
●They use the combination of Fargate, DynamoDB, SNS, SQS to support
hundreds of parcel delivery scans per minute
●During the year end season, their per day delivery scan increases from
thousands to nearly a million
●Even at the scale they were able to achieve the visibility of the freight
within 5 minutes of arrival to their end customer on their website
https://www.youtube.com/watch?v=E8wYXtvGy5k&t=178s

Databases
●In general, databases are hard to maintain and operate
●DBaaS platforms like Firebase, Parse, Supabase, etc are already quite
popular for particular use cases
●DynamoDB is the most popular Serverless NoSQL database
●Amazon Aurora Serverless is the SQL database with Serverless model
●AWS has many Databases services, some are purely Serverless like
DynamoDB, TimeStream, KeySpaces and others are Managed DBs like
RDS ElastiCache, and DocumentDB

●Snap is one of the largest users of DynamoDB
●With the sheer size and scale of the Snap application, any usage of
DynamoDB will be a massive usage
●In a recent video of “This is my Architecture”, they were storing around
400 TB of data into DynamoDB with nightly scan and other massive
operations per minute
https://www.youtube.com/watch?v=Cgv0kfp_6xQ&t=215s

●There are many emerging databases that provides the exact Serverless
model
●CockroachDB SQL servers with Serverless model
●MongoDB Atlast recently released the Serverless instances
●Upstash provides the Serverless Redis and Kafka instances

User Engagement
●Almost every application uses Email as a standard mechanism for user
communication
●Modern applications use multiple communication channels like SMS, Push
or Voice messages
●AWS services like SNS, SES and Pinpoint provides similar services with
Pinpoint having more granular features for Analytics
●These services offload the user endpoint management, endpoint
validation, batch dispatch and the delivery analytics as well

Amazon Connect is a Contact Center in the Cloud with Pay-as-Go
Pricing Model and Integration with many AWS services

Development Tools
●There are many options now, I usually suggest to start with Serverless
Framework and then adapt to others if you want better control
●AWS SAM (Serverless Application Model) is the native tool that is popular
among the developers as well – often you will find that experienced
developers are comfortable with both the frameworks
●Amazon Amplify is another framework that helps to integrate many of
these services with simple to follow CLI commands and create base code
structure

Monitoring and Observability
●Serverless helps in decentralising the overall application
●This introduces the problem of many small and divided
executions
●Hard to debug in case of complex use cases
●Continuous monitoring is required to ensure the
success of the overall application
●Many teams usually start with CloudWatch and X-Ray
and eventually move to external tools if they need more
granular insights and additional features
Image ref: Lumigo

Other Serverless Platforms
●Major Cloud Providers like Google Cloud and Microsoft Azure have their
own set of Serverless offerings
●3rd party platforms like Vercel.com provides end-to-end Serverless
experience by combining various services together
●Cloudflare Workers provides a massive global infrastructure to run the
Serverless scripts with high performance and low-latency

●Snyk is a popular application security provider that enables millions of
developers to build software securely
●They integrate with the DevOps pipeline to ingest and process the source
code for various vulnerabilities
●They use combination of API Gateway, Lambda, Step Functions and
DynamoDB to run the scans and deliver results
https://www.youtube.com/watch?v=iWK0iRUi-b4

References
●https://serverlessland.com/learn
●https://serverless.com/
●https://sst.dev/
●https://aws.amazon.com/architecture/this-is-my-architecture/

Thank You!!
LinkedIn - https://www.linkedin.com/in/dhavaln/
Twitter - https://twitter.com/dhavaln
Github - https://github.com/AppGambitStudio