Before you start your application
●Programming Language
○JavaScript, Python, Ruby, PHP
●Framework
○NodeJS, Django, Rails, Laravel
●Application Type
○Web Application
○Mobile Application Backend
○Headless Data Processing Application
●Where will you run it!
○Virtual Machine!!
○or other options?
Structure of a
Traditional Application
Application Structure
When everything is RUNNING
When something FAILS
When MANY users access
No User Requests
Monolithic Application
Overall it needs these...
●Fixed infrastructure in place
●Code/Processes are running 24x7
●Even if we are not doing anything we still need to pay by keeping the
infrastructure running
●Does not Scale to demand by default
Building Blocks of a Backend Application
●Authentication
●Compute
●Database
●Storage
●Security
●High Availability
●Performance Efficient
●Fault Tolerant
●Auto Scaling
●Cost Efficient
Building Blocks of an Application
●Authentication
○User Login
○Authorization
■Public URLs vs Private/Protected URLs
○Roles or Groups
■Normal User vs Admin Users
●Compute
○APIs
○Background Jobs (Scheduled vs Event)
●Database
○Relational
■MySQL, Postgres, MS SQL, Oracle
○NoSQL
■MongoDB, DynamoDB
●Storage
○Application Files, User Files
Let’s Look at a
Modern Application
Using Software-as-a-Service(s) to Build Application
Imagine Serverless!
Microservices Architecture
Why Serverless!
●FOCUS on business logic
●Cloud provider MANAGES the infrastructure, availability, scalability, and
security
●Pay for what you CONSUME
One of the most important papers published for
Serverless Computing
Cloud Programming Simplified:
A Berkeley View on Serverless Computing (Feb, 2019)
https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.pdf
WRITE LESS CODE!!
●Don’t REINVENT the WHEEL
●Use RIGHT SERVICE for RIGHT USE CASE
●LESS TIME spent on building same repititive tasks, MORE TIME spent on the
application features
●LESS CODE means LESS OPERATIONAL OVERHEAD
●OFFLOAD HEAVY LIFTING to purpose-built services
AWS Billing and Budget
●Take CARE of your AWS Account
●AWS Services are not FREE
●Each Service has different COST meter
●Make sure to configure proper Budget and Billing Alerts for your account
●This practice will help you FOREVER in your professional career
Service Cost Meter
Service Type Count Cost
API Gateway REST Requests 1 Million $3.50
HTTP Request 1 Million $1
Lambda Request 1 Million $0.20
Duration every GB-second $0.0000166667
SQS Standard Queue 1 Million Request
Every SQS action = 1 Request
Data Transfer In/Out separate
$0.40
DynamoDB On-Demand Read 1 Million $0.285
On-Demand Write 1 Million
Data Storage separate
Data Transfer In/Out separate
$1.4231
The cost after the AWS Free Tier Limits https://aws.amazon.com/free
Amazon S3 (Storage)
●Object Storage (this is different from file storage)
●No Provisioning Required, with Unlimited Data
●Accessible from URLs
●Pay for usage (storage and queries)
●Different Storage Tiers to optimize storage cost
○Standard
○Intelligent
○Infrequent
○And more...
●Highly Durable
●Highly Secure (if you configure it properly)
●Supports Web Hosting (this of Angular, React, Vue.js or Bootstrap based
FE)
Amazon Cognito (Authentication)
●User Management
●Secure and Scalable User Directory
●Social Media and Enterprise Directory Integration
●OAuth2.0 and OIDC Support
●EASY to Integrate
AWS Lambda (Compute)
●Serverless Compute Service
●Package and Upload your code with runtime configuration like
Memory and Concurrent requests
●Lambda runs the code on EVENTS (HTTP or Message in Queue)
●Lambda SCALES automatically
●Lambda is SECURE by default (ingress)
●Microservices-based implementation
●Least Operational Load (you can’t go inside Lambda)
●PAY ONLY WHEN IT RUNS (No events, no Consumption)
Amazon CloudWatch Logs & X-Ray
●Logging is VERY IMPORTANT
●CloudWatch is the DEFAULT logging service for Lambda
●Creates Metrics for different events
○Function Invocations
○Concurrent Function Executions
○Function Success vs Failure
○Function Execution Duration
AWS X-Ray - Service Map
AWS X-Ray - Traces
Amazon API Gateway (API Proxy)
●Serverless Gateway for APIs
●Highly Scalable
●Highly Secure (configurable)
●Various Integration Options
○Lambda
○SQS
○Step Functions
○Other AWS Services
○And even another HTTP Service
●Supports Different Types
○REST
○HTTP
○WebSocket
Amazon DynamoDB (Database)
●Serverless NoSQL Database
●Not your NORMAL Database
●DynamoDB has TABLES vs DATABASE
●User can perform READ and WRITE into TABLES
●Uses the PARTITION technique to SAVE Data
●Meant for HIGH SPEED, READ/WRITE operations
●Serverless In Nature, NO CONNECTION POOLING REQUIRED
●EVERY read and write COSTS, PAY-PER-USE
Aurora Serverless / RDS Proxy
●Not every application can use NoSQL Database like DynamoDB.
●Aurora Serverless is a Full Relational Database and SERVERLESS.
●Database starts when User Query comes (so it takes time).
●Meant for low usage applications where DB does not require to be running
forever.
●MySQL and Postgres are currently supported options in Aurora Serverless.
●If you use the regular RDS database from VPC, your code will need to
manage the Connections with MySQL or Postgres.
●RDS Proxy is a DATABASE CONNECTION MANAGEMENT Service.
●Lambda functions can use the RDS Proxy to connect with RDS Database
instead of creating and managing connections directly from the code.
Demo App - Simple API Service
●Serverless Framework with NodeJS
●API Gateway with Lambda
Demo - Serverless Bot using Web, SMS and Calls
●Works using Web page, SMS messages or Phone Calls (only in US)
●Scalable, Secure
●No Database Required
https://appgambit.gitbook.io/multi-model-aws-bot/
Keep Experimenting
●In Serverless environment, everything is distributed and asynchronous
●Serverless landscape is evolving rapidly, lot of opportunity to refactor and
optimize
Our understanding of how and when to use Serverless
architectures is still in its infancy. We’re starting to see patterns
of recommended practice occur, and this knowledge will only grow.
Martin Fowler
https://sls.dashbird.io/en/serverless-best-practices
Free Serverless Training Resources
●AWS Digital Training -
https://www.aws.training/Details/eLearning?id=42594
●Serverless Framework Free Courses -
https://www.serverless.com/learn/
●AWS Cloud Practitioner -
https://www.udemy.com/course/free-aws-certified-cloud-practiti
oner/
Q / A
Where to go from here
●AWS Well-Architected Framework for Serverless Applications
○https://aws.amazon.com/blogs/aws/new-serverless-lens-in-aws-well-architected-tool/
●AWS Heroes
○Yan Cui - https://theburningmonk.com/
○Jeremy Daly - https://jeremydaly.com/
○James Beswick (Serverless Developer Advocate, AWS)
■https://aws.amazon.com/blogs/compute/author/jbeswick/
●AWS Blogs for Serverless
○https://aws.amazon.com/blogs/compute/tag/serverless/
●Serverless Framework
○https://serverless.com/
●Serverless Application Model
○https://aws.amazon.com/serverless/sam/
The Hackathon Participants will receive the
AWS Voucher of $20