This document provides an overview of serverless architectures and discusses Capital One's journey to migrating their auto financing website to a serverless architecture on AWS. Some key points:
- Serverless architectures allow developers to build and run applications without having to manage infrastructure. Computing resources are allocated on demand.
- Capital One migrated their auto financing website from on-premises data centers to AWS to gain benefits like continuous deployment, auto-scaling, and cost savings.
- They moved the static content to S3 for hosting and rewrote the APIs as Lambda functions behind API Gateway for scalability. CI/CD pipelines were created to deploy content and code changes.
- The migration reduced costs by $50
19. “Can I go ahead
with the booking?”
“Book a hotel”
“Book a Hotel in
NYC”
Automatic Speech
Recognition
Hotel Booking
New York City
Natural Language
Understanding
Intent/Slot
Model
UtterancesHotel Booking
City New York City
Check In Nov 30th
Check Out Dec 2nd
“Your hotel is booked for
Nov 30th”
Amazon Polly
Confirmation: “Your hotel
is booked for Nov 30th”
Book Hotel
NYC
a
in
20. Amazon
Kinesis
AWS
Lambda 1
Amazon
CloudWatch
Amazon
DynamoDB
AWS
Lambda 2 Amazon
S3
Real-time data processing:
1. Real-time event data sent to Amazon Kinesis
allows multiple AWS Lambda functions to
process the same events
2. In AWS Lambda, Function 1 processes and
aggregates data from incoming events, then
stores result data in Amazon DynamoDB
3. Lambda Function 1 also sends values to
Amazon CloudWatch for simple monitoring of
metrics
4. In AWS Lambda function, Function 2 does data
manipulation of incoming events and stores
results in Amazon S3
https://s3.amazonaws.com/awslambda-reference-architectures/stream-processing/lambda-refarch-streamprocessing.pdf
Lambda + Kinesis
23. Serverless distributed computing: PyWren
PyWren prototype developed at University of California, Berkeley
Uses Python with AWS Lambda stateless functions for large-scale data
analytics
Achieved @ 30-40 MB/s write and read performance per core to Amazon S3
object store
Scaled to 60-80 GB/s across 2,800 simultaneous functions
26. How Home24 lowered costs by 99%
Home24 sequenced a varying number of
Lambda functions with AWS Step Functions
to download and refine files from multiple
sources
• Cost savings: Saved 99% with AWS Step
Functions as opposed to their previous
SaaS solution
• Productivity and agility: Engineers can
easily coordinate various microservices
to build ELT pipelines
• Increased resilience: Automatic retries
when service APIs are unavailable
29. Capital One
• Top 10 US bank
• Al exa Websi te
Ranki ng says
capi tal one.com
traffi c i s “ 81st i n
US Web Si tes”
• Auto fi nanci ng —
one mi l l i on
hi ts/month
31. Migration requirements
• Full functionality and more
• Secure—yes, we actually are a financial institution
• Resilient (active/active)
• Responsive—front-facing marketing home page, so initial load time is critical
• SEO-friendly
• Continuous deployments—changes on demand
• Low-maintenance—it just needs to run
• Use existing tools and processes in the enterprise—don’t reinvent the wheel
• Logging
• Monitoring
• Deployments
32. The painful old days
• H o s t e d i n o n - p r e m i s e s
d a t a c e n t e r
• E n t e r p r i s e - w i d e
c o m m o n d e p l o y m e n t s
• O n e c a l e n d a r —
f e a t u r e s p l a n n e d
m o n t h s i n a d v a n c e
• T i g h t c o u p l i n g
b e t w e e n c o m p o n e n t s
36. CI/CD for content
• A p p t e m p l a t e s i n
G i t H u b
• C o n t e n t i n C M S h o s t e d
s e r v i c e
• P r e - r e n d e r a n g u l a r
c o n t e n t , S E O - f r i e n d l y
• U s e A W S C L I t o p u s h
c o n t e n t t o A m a z o n S 3
b u c k e t f o r w e b
h o s t i n g
Content Management
System
AWS CLI
Amazon EC2
Build Server
Content S3 Bucket
38. Move to serverless APIs
Amazon
Route 53
Rest APIs
CapOne
Enterprise
Gateway
Lambda
Fn
Amazon
CloudWatch
Lambda
Fn
East
CapOne
Enterprise
Gateway
Lambda
Fn
Amazon
CloudWatch
Lambda
Fn
West
39. CI/CD—Lambda functions
AWS CLI
Deployment S3 Bucket
Lambda Create
Lambda Update
Lamba Fn
• L a m b d a c o d e i n G i t H u b
• J e n k i n s - t r i g g e r e d b u i l d
• U s e s A W S C L I
• D e p l o y i n A m a z o n S 3
b u c k e t
• C r e a t e / u p d a t e
L a m b d a f u n c t i o n
• O t h e r o p t i o n s :
• S A M
• S e r v e r l e s s f r a m e w o r k
40. Benefits of serverless
• Very simple architecture
• Runs itself, less monitoring
• Scales itself, no work on auto scaling needed
• No worries on AMI rehydration, which keeps compliance and
operations happy
• Cost savings:
• Conservative savings to tune of $50K/year
• Amazon S3 web hosting eliminated any Amazon EC2 needs for
website hosting
• Able to eliminate 20 Amazon EC2 instances, CLBs, and Amazon EBS
volumes from API architecture
• Countless hours saved on operations of application
41. Lessons learned
• Migration can be a journey, so plan accordingly
• Step-by-step progress is recommended
• Start small
• Serverless architectures are flexible and fungible
• No one size fits all
• Reuse tools and processes in the organization
• Get stakeholder buy-in early