Thanh Nguyen
+84 938203080
nnthanh101@gmail.com
Serverless Architecture 101 ⚡
Agenda
Why are Customers adopting a Serverless-first Strategy?
AXA >> Rearchitecting with Serverless to accelerate innovation
Thinking Serverless
from Business Problem to Serverless Solution ⚡
Getting started with serverless for developers
Demo & Discussion
Quiz
© 2021
3
What do our customers need to drive success?
Get to market faster High performance
and scalability
Security and
isolation by design
Lower total cost of
ownership
© 2021
4
CIO’s say that 80% of developers’ time is spent on the operations
and maintenance of applications and only 20% of the time is
actually spent on innovation
Source: Deloitte 2019
© 2021
6
Why are customers building with a serverless-first
strategy?
Agility Performance Cost Security
© 2021
7
How are customers adopting a serverless strategy?
Lift and shift
REDUCE
the amount of DIY
MIGRATE
to AWS
MODERNIZE
onAWS
Retire SaaS Refactor
Replatform
BUILD NEW INNOVATION
© 2021
8
Computing evolution – A paradigm shift
LEVEL
OF
ABSTRACTION
FOCUS ON BUSINESS LOGIC
PHYSICAL MACHINES
Requires “guess” planning
Lives for years on-premises
Heavy investments (capex)
Low innovation factor
Deploy in months
© 2021
9
Computing evolution – A paradigm shift
LEVEL
OF
ABSTRACTION
FOCUS ON BUSINESS LOGIC
VIRTUAL MACHINES
Hardware independence
Faster provisioning speed (minutes/hours)
Trade capex for opex
More scale
Elastic resources
Faster speed and agility
Reduced maintenance
© 2021
10
Computing evolution – A paradigm shift
LEVEL
OF
ABSTRACTION
FOCUS ON BUSINESS LOGIC
CONTAINERIZATION
Platform independence
Consistent runtime environment
Higher resource utilization
Easier and faster deployments
Isolation and sandboxing
Start speed (deploy in seconds)
© 2021
11
Computing evolution – A paradigm shift
AWS Lambda
AWS Fargate
LEVEL
OF
ABSTRACTION
FOCUS ON BUSINESS LOGIC
Continuous scaling
Fault tolerance built-in
Pay for value
Zero maintenance
SERVERLESS
© 2021
12
Leap Frog Adoption
C
A
PA
C
I
T
Y
P
R
O
C
E
S
S
E
S
C
O
S
T
M
O
D
E
L
S
OP ER AT I ON AL P R OCESS ES DEV ELOP MEN T MODELS
ON-PREMISES
CLOUD
“LEGACY”ARCHITECTURES MODERNARCHITECTURES
AWS
EC2
AWS
ECS
AWS
FARGATE
AWS
EKS
Containers
AWS
ECS
AWS
FARGATE
AWS
EKS
© 2021
13
What is Serverless?
No infrastructure provisioning,
no management
Automatic scaling
Pay for value Highly available and secure
© 2021
Serverless Architecture
Event Source Function Services / Other
Node.js
Python
Java
C#
Go
Ruby
BringYour Own
Changes in
data state
Requests to
endpoints
Changes in
resource state
© 2021
15
Lambda execution model
© 2020, AmazonWeb Services, Inc. or its affiliates. All rights
Synchronous (push) Asynchronous (event) Stream-based
Amazon API
Gateway
Lambda
function
Amazon DynamoDB
Amazon SNS
/order
Lambda
function
Amazon S3
Reqs
Amazon Kinesis
Changes
AWS Lambda
service
Function
© 2021
16
AWS
Lambda
AWS
Fargate
Amazon
API Gateway
Amazon
SNS
Amazon
SQS
AWS
Step Functions
COMPUTE
DATA STORES
INTEGRATION
AWS
AppSync
Amazon Aurora
Serverless
Amazon
S3
Amazon
DynamoDB
Amazon
EventBridge
AXA:RearchitectingwithServerlessto accelerate
innovation
Multinational insurance firm that
engages in property-casualty insurance,
life and savings, and asset management
Present in 57 countries, with 160,000
employees and distributors, to serve our
108 million clients
AXA Group Operations
Emerging technologies
and data division
Explores and scales value of data and
emerging technologies with potential to
disrupt current insurance
business model
AXA GO
6 years in business
Flagship project – automotive
telematics, which combine data science
and data processing chain
Team-developed and maintained
solution (data science, network, mobile,
backend, and so on)
Telematics team
Business rational
• Develop data-driven motor
insurance policies
• Pay per mile, per day, per risk profile, with
periodic premium adjustment
• Provide immediate “post-trip” risk feedback to
help customer drive safer
Where we are today
• Live connection with black boxes, smartphones,
and native car connectivity
as GPS sources
• 5 offers on EU market
• 40,000+ customers
• 60,000+ vehicle trips per day
AXA-TEXproject –TelematicsExchange platform
AXA-TEX– High-levelfunctional view
Sources Acquisition
Storage
Analysis
….
Processing
OBD
Presentation
Box
Smartphone
Weather
Mapping
Algorithms and Data Lake
Connected Car
Dashboard
App
API
1 AWS account,
multiple environments
Over 50 Amazon EC2 instances in total
Designed for portability to
AXA data center
• Deployment with Ansible
• Limited AWS technologies used
• Infrastructure withTerraform
AXA-TEXas webuilt it in 2015 (v1)
Elastic Load
Balancing
AWS Cloud
Admin
Shinken
Syslog
Scoring
Business logic
Flume
Datafront
HAProxy
Business logic
Nginx
Analytics
Carbon
Grafana
Kibana
Dashboards
Nginx
Business logic
Worker
Apache Kafka
Zookeeper
MongoDB
PostgreSQL
Business logic
Elasticsearch
Elasticsearch
Efforts to manage
• Setup of monitoring tools
• Regular fix / security
updates needed
• Difficult to add new components
• Deployment complex and slow
• HSM and IPSec links to manage due to
strong security constraints
Whyweneeded tochange?
Focus on features
We want to spend more
time developing
functionalities than
managing a system
Easier scaling
Scalability of our
architecture is possible, but
both manual and difficult
Lack of scalability of some
components due to hasty
decisions
Less system
engineering
Amazon EC2 management
requires regular system
updates, advanced
monitoring and major
operational challenges
More security
We are subject to strong
constraints that are
difficult for our team to
manage
TEXv2
Messaging /
event
streaming
ESBs
Amazon Managed Streaming
for Apache Kafka (Amazon MSK)
Amazon Kinesis Amazon SQS / Amazon SNS
Kafka on
Amazon EC2
AWS operational responsibilitymodels
On-premises Cloud - IaaS
TEX v1
Less
More
Compute
Virtual
machine Amazon EC2 AWS Elastic Beanstalk AWS Lambda
AWS Fargate
Relational
database
PostgreSQL PostgreSQL on
Amazon EC2
Amazon RDS Amazon Aurora Aurora Serverless
Amazon DynamoDB
MongoDB MongoDB on
Amazon EC2
Amazon DocumentDB
Document-
oriented
database
Cloud - Serverless
Moving toserverless –Compute
Virtual machine
on-premises
Amazon EC2 Elastic Beanstalk Lambda
Fargate
TEX v1
Usage
Asynchronous processing of
car data stream
Benefits
• High scalability
• Cost optimization
• Integration with
other AWS services (e.g.,
Kinesis)
Usage
• Communication
with telematics
boxes via UDP
• Long batches
Benefits
• Flexibility of containers
• Serverless infrastructure
90%
10%
Moving toserverless – Messaging/Streaming
Usage
Message queue to compute
driver score
Benefits
Automatic scalability
Usage
• Car event streaming
• Multiple consumers
• Need to preserve order
Benefits
• Easy to scale by increasing
number
of shards
• Possibility to
TEX v1
Amazon MSK Kinesis
Amazon SQS /
Amazon SNS
Kafka on
Amazon EC2
Kafka
on-premises
Data
Database
TEX v1
Database
TEX v2
Current trips
MongoDB
on Amazon EC2
DynamoDB
Moving toserverless:Databases
Data
Database
TEX v1
Database
TEX v2
Current trips
MongoDB
on Amazon EC2
DynamoDB
Driver scores /
trips history
Elasticsearch
on Amazon EC2 Aurora
Serverless –
PostgreSQL
Cartography
PostgreSQL
on Amazon EC2
Messaging /
event
streaming
ESBs
Amazon MSK Kinesis Amazon SQS /
Amazon SNS
Kafka on
Amazon EC2
AWS operational responsibilitymodels
Compute
Virtual
machine Amazon EC2 Elastic Beanstalk Lambda
Fargate
On-premises
Less
More
Relational
database
PostgreSQL PostgreSQL on
Amazon EC2
Amazon RDS Aurora Aurora Serverless
DynamoDB
MongoDB MongoDB on
Amazon EC2
Amazon
DocumentDB
Document-
oriented
database
TEX v1 TEX v2
Cloud - IaaS Cloud - Serverless
TEXv2 –Simplified processing pipeline
Supervision and monitoring
KMS ACM Secrets Manager CloudWatch Route 53 Parameter
Store
AWS Cloud
Athena
EMR
Kinesis
Firehose
Fargate
Specific
Tools
S3
Data lake
Aurora
Trips
Aurora
Scores
Persistence
AXA entities
Lambda
API
GW
Data presentation
Enrichment
Traffic data
provider
Weather data
provider
Lambda
Aurora
Cartography
Amazon
ElastiCach
e
API
GW
Ingestion
Driving data
provider
S3
Lambda
Lambda
CloudWatch
Events
Processing
DynamoDB
Sessions
Kinesis Kinesis SQS
Lambda
Enrichment
Lambda
Trip Creation
Lambda
Driving Score
Business logic scaling effect
• Smoothly scale depending on road traffic
• Development environment – no traffic
≃$0 for Lambda
• Production environment – lower cost than
fault-tolerant servers dedicated to business logic
TEXv2 – Lambda activities
Kinesis incoming records Data enrichment
Lambda invocations
AXA Landing Zone
• Activation of monitoring and security tools,
such as CloudTrail, Amazon GuardDuty, service
control policies, and so on
• Authentication management
• Ensure compliance with Config
• Centralized billing
 Presentation made at AWS re:Invent 2019
TEXv2 –AWSAccounts organization
Developers
Terraform
deployment
Read only
Terraform
deployment
Data scientists
AXA Landing Zone
Project Project Project
Git
Analytics
Tools
TEX Production
Preprod and UAT
Integration
Developer account
Developer account
Developer account
AXA organization
VPC peering
TEX
Foundation
AXA
Foundation
Prime accounts
One AWS account per variant – prod, preprod,
development
Analytics account
• Read-only access for the production
• VPC peering for Aurora access
• Monitored actions of data scientists
Tools account
• CI / CD (Jenkins)
• Artifact library (S3)
• DNS management
TEXv2 – Did we succeedin resolvingour issues?
Less system
engineering
Easier scaling More security Focus on features
✓ ✓ ✓ ✓
A full class of issues
disappeared with the
serverless migration
The architecture and the
infrastructure just scale
Some components may
need manual tuning
We spend less time in
maintaining the
infrastructure,
So we are more comfortable
in adding new features
We do not think about it
anymore
Remaining tasks are on
database performance with
business logic
Lessons learned
Aurora Serverless requires aVPC configuration
Kinesis shards and Aurora units need manual tuning
Full serverless is not always possible, hybrid approach should be kept in
mind and integrated in infrastructure as code
Fewer features with Aurora Serverless than with Amazon RDS equivalents
Kinesis costs, even if not used
Serverless still needs configuration
Hybrid architecture
Techno maturity
Lambda can scale too much and be costly if bug in logic or
architecture – set alarms and limits
Control automatic scaling
 State management
 Monolithic container for functionality
 One version, one server
 Server is an atomic unit of thinking
 The challenges of this model
How do weuseServers?
Features first Focus on Events Stateless Data-flow Use the Services
Avoid monolithic
thinking
Events are triggers
that cause action
The key to
scaling
effectively
Make data
decisions early on
Don’t reinvent
the wheel
GeneralApproach toThinkingServerless
Attributes
 Runs on demand
 Supports many runtimes
 Responds to events
 Stateless
 Automatically scales
Best practices
 Avoid lift-and-shift
 One function per purpose
 Keep functions small
 Choose the right runtime for the job
 Use functions for business logic and
plumbing between services
✍️Understanding howAWS Lambda fitsin
 Infrastructure is disposable
 Asynchronous versus synchronous processing
 You can mix and match runtimes
 Security still matters: build in from the start
 Automation
 AWS Serverless Application Model (AWS SAM)
 The AWS Cloud Development Kit (AWS CDK)
 Serverless Framework
✍️GoodServerlesspractices
1. Form upload
Create a serverless application to support a customer review form submitted from
a webpage
1. Form upload
Create a serverless application to support a customer review form submitted from
a webpage
Amazon
API Gateway
AWS Lambda Amazon
DynamoDB
1. Form upload
Create a serverless application to support a customer review form submitted
from a webpage
Amazon
API Gateway
AWS Lambda Amazon
DynamoDB
AWS Lambda Amazon
Translate
1. Form upload
Create a serverless application to support a customer review form submitted
from a webpage
AWS Lambda
Amazon S3
1. Form upload
Create a serverless application to support a customer review form submitted
from a webpage
AWS Lambda
Amazon SNS
Amazon
Comprehend
1. Form upload
Create a serverless application to support a customer review form submitted from
a webpage
Amazon Cognito
Amazon API
Gateway
A global retailer wants to implement a virtual queue for customers. Use an IoT
button to manage a “now serving” counter.
2.Createa virtualqueue
A global retailer wants to implement a virtual queue for customers. Use an IoT
button to manage a “now serving” counter.
2.Createa virtualqueue
IoT button AWS IoT Core AWS Lambda Amazon
DynamoDB
AWS Lambda
Amazon API
Gateway
Customer display
A global retailer wants to implement a virtual queue for customers. Use an IoT
button to manage a “now serving” counter.
2.Createa virtualqueue
AWS Lambda AWS IoT Core Customer display
A global retailer wants to implement a virtual queue for customers. Use an IoT
button to manage a “now serving” counter.
2.Createa virtualqueue
AWS Lambda
Amazon S3
Amazon Polly
A global retailer wants to implement a virtual queue for customers. Use an IoT
button to manage a “now serving” counter.
2.Createa virtualqueue
Amazon
EventBridge rule
(scheduled)
AWS Lambda Amazon SNS
A global retailer wants to implement a virtual queue for customers. Use an IoT
button to manage a “now serving” counter.
2.Createa virtualqueue
Create a serverless web application to
support an e-commerce business
 High volume, spiky,
unpredictable traffic patterns
 Geographically distributed
 Requires high performance
front-end, low latency
3.WebApplication
Create a serverless web application to support a national e-commerce business
3.Web application
Browser
Amazon Route 53 AWS Amplify
console
GitHub repo
Create a serverless web application to support a national e-commerce business
3.Web application
Amazon
Cognito
Auth0
Create a serverless web application to support a national e-commerce business
3.Web application
Amazon
API Gateway
AWS Lambda
Amazon
S3
AWS Lambda Amazon
S3
AWS Lambda Amazon
DynamoDB
1.Serverlessfor Developers
2.Thebusinesslogic
3.Thefront door
4.Localdeveloper workflow
5.Sandbox developer account
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
© 2020, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
Serverl
ess
vocabu
lary
Live Demo
https://dashboard.job4u.io
KPI Dashboard on AWS
Data Ingestion API
Operations
 Runbook: logging, monitoring, alerting on issues
 Scaling: how to scale Performance Dashboard
 Security
 Shared Responsibility between AWS & Customer
 IP Blocking: limit access to come from
an IP range (e.g. on-premises network)
© 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
© 2020, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
Serverl
ess
vocabu
lary
LAB
https://webapp.serverlessworkshops.io/
https://github.com/aws-samples/getting-
started-with-serverless
Thankyou!
© 2021
https://www.facebook.com/groups/devax
https://github.com/DevAx101/MicroServices
https://github.com/DevAx101/Terraform
https://dashboard.job4u.io 🔥

Serverless Architecture 101 ⚡

  • 1.
  • 2.
    Agenda Why are Customersadopting a Serverless-first Strategy? AXA >> Rearchitecting with Serverless to accelerate innovation Thinking Serverless from Business Problem to Serverless Solution ⚡ Getting started with serverless for developers Demo & Discussion Quiz
  • 3.
    © 2021 3 What doour customers need to drive success? Get to market faster High performance and scalability Security and isolation by design Lower total cost of ownership
  • 4.
    © 2021 4 CIO’s saythat 80% of developers’ time is spent on the operations and maintenance of applications and only 20% of the time is actually spent on innovation Source: Deloitte 2019
  • 5.
    © 2021 6 Why arecustomers building with a serverless-first strategy? Agility Performance Cost Security
  • 6.
    © 2021 7 How arecustomers adopting a serverless strategy? Lift and shift REDUCE the amount of DIY MIGRATE to AWS MODERNIZE onAWS Retire SaaS Refactor Replatform BUILD NEW INNOVATION
  • 7.
    © 2021 8 Computing evolution– A paradigm shift LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC PHYSICAL MACHINES Requires “guess” planning Lives for years on-premises Heavy investments (capex) Low innovation factor Deploy in months
  • 8.
    © 2021 9 Computing evolution– A paradigm shift LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC VIRTUAL MACHINES Hardware independence Faster provisioning speed (minutes/hours) Trade capex for opex More scale Elastic resources Faster speed and agility Reduced maintenance
  • 9.
    © 2021 10 Computing evolution– A paradigm shift LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC CONTAINERIZATION Platform independence Consistent runtime environment Higher resource utilization Easier and faster deployments Isolation and sandboxing Start speed (deploy in seconds)
  • 10.
    © 2021 11 Computing evolution– A paradigm shift AWS Lambda AWS Fargate LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC Continuous scaling Fault tolerance built-in Pay for value Zero maintenance SERVERLESS
  • 11.
    © 2021 12 Leap FrogAdoption C A PA C I T Y P R O C E S S E S C O S T M O D E L S OP ER AT I ON AL P R OCESS ES DEV ELOP MEN T MODELS ON-PREMISES CLOUD “LEGACY”ARCHITECTURES MODERNARCHITECTURES AWS EC2 AWS ECS AWS FARGATE AWS EKS Containers AWS ECS AWS FARGATE AWS EKS
  • 12.
    © 2021 13 What isServerless? No infrastructure provisioning, no management Automatic scaling Pay for value Highly available and secure
  • 13.
    © 2021 Serverless Architecture EventSource Function Services / Other Node.js Python Java C# Go Ruby BringYour Own Changes in data state Requests to endpoints Changes in resource state
  • 14.
    © 2021 15 Lambda executionmodel © 2020, AmazonWeb Services, Inc. or its affiliates. All rights Synchronous (push) Asynchronous (event) Stream-based Amazon API Gateway Lambda function Amazon DynamoDB Amazon SNS /order Lambda function Amazon S3 Reqs Amazon Kinesis Changes AWS Lambda service Function
  • 15.
    © 2021 16 AWS Lambda AWS Fargate Amazon API Gateway Amazon SNS Amazon SQS AWS StepFunctions COMPUTE DATA STORES INTEGRATION AWS AppSync Amazon Aurora Serverless Amazon S3 Amazon DynamoDB Amazon EventBridge
  • 16.
    AXA:RearchitectingwithServerlessto accelerate innovation Multinational insurancefirm that engages in property-casualty insurance, life and savings, and asset management Present in 57 countries, with 160,000 employees and distributors, to serve our 108 million clients AXA Group Operations Emerging technologies and data division Explores and scales value of data and emerging technologies with potential to disrupt current insurance business model AXA GO 6 years in business Flagship project – automotive telematics, which combine data science and data processing chain Team-developed and maintained solution (data science, network, mobile, backend, and so on) Telematics team
  • 17.
    Business rational • Developdata-driven motor insurance policies • Pay per mile, per day, per risk profile, with periodic premium adjustment • Provide immediate “post-trip” risk feedback to help customer drive safer Where we are today • Live connection with black boxes, smartphones, and native car connectivity as GPS sources • 5 offers on EU market • 40,000+ customers • 60,000+ vehicle trips per day AXA-TEXproject –TelematicsExchange platform
  • 18.
    AXA-TEX– High-levelfunctional view SourcesAcquisition Storage Analysis …. Processing OBD Presentation Box Smartphone Weather Mapping Algorithms and Data Lake Connected Car Dashboard App API
  • 19.
    1 AWS account, multipleenvironments Over 50 Amazon EC2 instances in total Designed for portability to AXA data center • Deployment with Ansible • Limited AWS technologies used • Infrastructure withTerraform AXA-TEXas webuilt it in 2015 (v1) Elastic Load Balancing AWS Cloud Admin Shinken Syslog Scoring Business logic Flume Datafront HAProxy Business logic Nginx Analytics Carbon Grafana Kibana Dashboards Nginx Business logic Worker Apache Kafka Zookeeper MongoDB PostgreSQL Business logic Elasticsearch Elasticsearch Efforts to manage • Setup of monitoring tools • Regular fix / security updates needed • Difficult to add new components • Deployment complex and slow • HSM and IPSec links to manage due to strong security constraints
  • 20.
    Whyweneeded tochange? Focus onfeatures We want to spend more time developing functionalities than managing a system Easier scaling Scalability of our architecture is possible, but both manual and difficult Lack of scalability of some components due to hasty decisions Less system engineering Amazon EC2 management requires regular system updates, advanced monitoring and major operational challenges More security We are subject to strong constraints that are difficult for our team to manage
  • 21.
  • 22.
    Messaging / event streaming ESBs Amazon ManagedStreaming for Apache Kafka (Amazon MSK) Amazon Kinesis Amazon SQS / Amazon SNS Kafka on Amazon EC2 AWS operational responsibilitymodels On-premises Cloud - IaaS TEX v1 Less More Compute Virtual machine Amazon EC2 AWS Elastic Beanstalk AWS Lambda AWS Fargate Relational database PostgreSQL PostgreSQL on Amazon EC2 Amazon RDS Amazon Aurora Aurora Serverless Amazon DynamoDB MongoDB MongoDB on Amazon EC2 Amazon DocumentDB Document- oriented database Cloud - Serverless
  • 23.
    Moving toserverless –Compute Virtualmachine on-premises Amazon EC2 Elastic Beanstalk Lambda Fargate TEX v1 Usage Asynchronous processing of car data stream Benefits • High scalability • Cost optimization • Integration with other AWS services (e.g., Kinesis) Usage • Communication with telematics boxes via UDP • Long batches Benefits • Flexibility of containers • Serverless infrastructure 90% 10%
  • 24.
    Moving toserverless –Messaging/Streaming Usage Message queue to compute driver score Benefits Automatic scalability Usage • Car event streaming • Multiple consumers • Need to preserve order Benefits • Easy to scale by increasing number of shards • Possibility to TEX v1 Amazon MSK Kinesis Amazon SQS / Amazon SNS Kafka on Amazon EC2 Kafka on-premises
  • 25.
    Data Database TEX v1 Database TEX v2 Currenttrips MongoDB on Amazon EC2 DynamoDB Moving toserverless:Databases Data Database TEX v1 Database TEX v2 Current trips MongoDB on Amazon EC2 DynamoDB Driver scores / trips history Elasticsearch on Amazon EC2 Aurora Serverless – PostgreSQL Cartography PostgreSQL on Amazon EC2
  • 26.
    Messaging / event streaming ESBs Amazon MSKKinesis Amazon SQS / Amazon SNS Kafka on Amazon EC2 AWS operational responsibilitymodels Compute Virtual machine Amazon EC2 Elastic Beanstalk Lambda Fargate On-premises Less More Relational database PostgreSQL PostgreSQL on Amazon EC2 Amazon RDS Aurora Aurora Serverless DynamoDB MongoDB MongoDB on Amazon EC2 Amazon DocumentDB Document- oriented database TEX v1 TEX v2 Cloud - IaaS Cloud - Serverless
  • 27.
    TEXv2 –Simplified processingpipeline Supervision and monitoring KMS ACM Secrets Manager CloudWatch Route 53 Parameter Store AWS Cloud Athena EMR Kinesis Firehose Fargate Specific Tools S3 Data lake Aurora Trips Aurora Scores Persistence AXA entities Lambda API GW Data presentation Enrichment Traffic data provider Weather data provider Lambda Aurora Cartography Amazon ElastiCach e API GW Ingestion Driving data provider S3 Lambda Lambda CloudWatch Events Processing DynamoDB Sessions Kinesis Kinesis SQS Lambda Enrichment Lambda Trip Creation Lambda Driving Score
  • 28.
    Business logic scalingeffect • Smoothly scale depending on road traffic • Development environment – no traffic ≃$0 for Lambda • Production environment – lower cost than fault-tolerant servers dedicated to business logic TEXv2 – Lambda activities Kinesis incoming records Data enrichment Lambda invocations
  • 29.
    AXA Landing Zone •Activation of monitoring and security tools, such as CloudTrail, Amazon GuardDuty, service control policies, and so on • Authentication management • Ensure compliance with Config • Centralized billing  Presentation made at AWS re:Invent 2019 TEXv2 –AWSAccounts organization Developers Terraform deployment Read only Terraform deployment Data scientists AXA Landing Zone Project Project Project Git Analytics Tools TEX Production Preprod and UAT Integration Developer account Developer account Developer account AXA organization VPC peering TEX Foundation AXA Foundation Prime accounts One AWS account per variant – prod, preprod, development Analytics account • Read-only access for the production • VPC peering for Aurora access • Monitored actions of data scientists Tools account • CI / CD (Jenkins) • Artifact library (S3) • DNS management
  • 30.
    TEXv2 – Didwe succeedin resolvingour issues? Less system engineering Easier scaling More security Focus on features ✓ ✓ ✓ ✓ A full class of issues disappeared with the serverless migration The architecture and the infrastructure just scale Some components may need manual tuning We spend less time in maintaining the infrastructure, So we are more comfortable in adding new features We do not think about it anymore Remaining tasks are on database performance with business logic
  • 31.
    Lessons learned Aurora Serverlessrequires aVPC configuration Kinesis shards and Aurora units need manual tuning Full serverless is not always possible, hybrid approach should be kept in mind and integrated in infrastructure as code Fewer features with Aurora Serverless than with Amazon RDS equivalents Kinesis costs, even if not used Serverless still needs configuration Hybrid architecture Techno maturity Lambda can scale too much and be costly if bug in logic or architecture – set alarms and limits Control automatic scaling
  • 32.
     State management Monolithic container for functionality  One version, one server  Server is an atomic unit of thinking  The challenges of this model How do weuseServers?
  • 34.
    Features first Focuson Events Stateless Data-flow Use the Services Avoid monolithic thinking Events are triggers that cause action The key to scaling effectively Make data decisions early on Don’t reinvent the wheel GeneralApproach toThinkingServerless
  • 35.
    Attributes  Runs ondemand  Supports many runtimes  Responds to events  Stateless  Automatically scales Best practices  Avoid lift-and-shift  One function per purpose  Keep functions small  Choose the right runtime for the job  Use functions for business logic and plumbing between services ✍️Understanding howAWS Lambda fitsin
  • 36.
     Infrastructure isdisposable  Asynchronous versus synchronous processing  You can mix and match runtimes  Security still matters: build in from the start  Automation  AWS Serverless Application Model (AWS SAM)  The AWS Cloud Development Kit (AWS CDK)  Serverless Framework ✍️GoodServerlesspractices
  • 37.
    1. Form upload Createa serverless application to support a customer review form submitted from a webpage
  • 38.
    1. Form upload Createa serverless application to support a customer review form submitted from a webpage Amazon API Gateway AWS Lambda Amazon DynamoDB
  • 39.
    1. Form upload Createa serverless application to support a customer review form submitted from a webpage Amazon API Gateway AWS Lambda Amazon DynamoDB AWS Lambda Amazon Translate
  • 40.
    1. Form upload Createa serverless application to support a customer review form submitted from a webpage AWS Lambda Amazon S3
  • 41.
    1. Form upload Createa serverless application to support a customer review form submitted from a webpage AWS Lambda Amazon SNS Amazon Comprehend
  • 42.
    1. Form upload Createa serverless application to support a customer review form submitted from a webpage Amazon Cognito Amazon API Gateway
  • 43.
    A global retailerwants to implement a virtual queue for customers. Use an IoT button to manage a “now serving” counter. 2.Createa virtualqueue
  • 44.
    A global retailerwants to implement a virtual queue for customers. Use an IoT button to manage a “now serving” counter. 2.Createa virtualqueue IoT button AWS IoT Core AWS Lambda Amazon DynamoDB AWS Lambda Amazon API Gateway Customer display
  • 45.
    A global retailerwants to implement a virtual queue for customers. Use an IoT button to manage a “now serving” counter. 2.Createa virtualqueue AWS Lambda AWS IoT Core Customer display
  • 46.
    A global retailerwants to implement a virtual queue for customers. Use an IoT button to manage a “now serving” counter. 2.Createa virtualqueue AWS Lambda Amazon S3 Amazon Polly
  • 47.
    A global retailerwants to implement a virtual queue for customers. Use an IoT button to manage a “now serving” counter. 2.Createa virtualqueue Amazon EventBridge rule (scheduled) AWS Lambda Amazon SNS
  • 48.
    A global retailerwants to implement a virtual queue for customers. Use an IoT button to manage a “now serving” counter. 2.Createa virtualqueue
  • 49.
    Create a serverlessweb application to support an e-commerce business  High volume, spiky, unpredictable traffic patterns  Geographically distributed  Requires high performance front-end, low latency 3.WebApplication
  • 50.
    Create a serverlessweb application to support a national e-commerce business 3.Web application Browser Amazon Route 53 AWS Amplify console GitHub repo
  • 51.
    Create a serverlessweb application to support a national e-commerce business 3.Web application Amazon Cognito Auth0
  • 52.
    Create a serverlessweb application to support a national e-commerce business 3.Web application Amazon API Gateway AWS Lambda Amazon S3 AWS Lambda Amazon S3 AWS Lambda Amazon DynamoDB
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark © 2020, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Serverl ess vocabu lary Live Demo https://dashboard.job4u.io KPI Dashboard on AWS Data Ingestion API Operations  Runbook: logging, monitoring, alerting on issues  Scaling: how to scale Performance Dashboard  Security  Shared Responsibility between AWS & Customer  IP Blocking: limit access to come from an IP range (e.g. on-premises network)
  • 60.
    © 2021, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark © 2020, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Serverl ess vocabu lary LAB https://webapp.serverlessworkshops.io/ https://github.com/aws-samples/getting- started-with-serverless
  • 61.