In the middle of 2015, Expedia started using AWS Lambda for serverless computing. We built boilerplate templates in Node.js, Java, and Python so development teams could build and deploy serverless applications into AWS. Currently, we have 300 AWS Lambda functions processing 40 million invocations per day.
In this session, we will discuss how development teams use boilerplate templates to create serverless applications with Amazon API Gateway and AWS Lambda and how they deploy them to AWS. We will cover patterns, architectural design choices, and the benefits --- like cost, scale, availability, and operations --- of running serverless applications.
Report
Share
Report
Share
1 of 73
Download to read offline
More Related Content
AWS re:Invent 2016: Serverless Computing Patterns at Expedia (SVR306) )
3. Expedia, Inc., at a glance
Notes: Expedia, Inc. results shown for 2015. 1Gross bookings is an operating and statistical metric that captures the total dollar value, generally inclusive of taxes and fees, of travel services booked by
our customers; gross bookings excludes HomeAway. 2Monthly visits based on data for Brand Expedia (including Travelocity and Wotif), Hotels.com, Orbitz Worldwide, HomeAway, trivago and Hotwire
combined during 2015.
Sources: Overall travel industry growth rate based on Phocuswright data for 2015 Y/Y.
Largest travel company
$60B
gross bookings1
$6.6B revenue growing
>2X faster vs. industry
18K+ employees globally
450M+ monthly site visits2
75+ countries served
1.5M+ lodging options
for travelers
4. What to Expect from the Session
• AWS Lambda Usage at Expedia
• Serverless Apps Creation at Expedia
• Different Serverless App architectures
• Demo
7. What is AWS Lambda?
• Run code for virtually any type of application
• No Servers to Manage
• Zero administration
• Continuous Scaling
• Sub second Metering
50. Typeahead (ESS – Expedia Suggest Service)
• Typeahead is the first feature that users interact with while
searching for what they are looking for, so providing best
possible suggestions to them is very essential
• ElasticCache Redis + IN-MEMORY data for cache misses
• 25 GB Heap Size per EC2 Instance
• Daily refresh of this data and it takes 15 mins to load the data
52. The Problem
• Currently each instance that runs ESS in prod has to have
enough memory to support this data refresh process while
still serving requests
• When the occupied heap reaches its maximum limit, the
application:
• often freezes resulting in not able to recommend right
suggestions to the customers
• pauses until garbage collection completes discarding the
large, outdated BLOB from memory
53. Solution
• Eliminate data refresh process via crontab
• Launch N new instances by modifying the Auto Scaling group
every day during refresh time
• Modify Auto Scaling group to terminate N instances using
OldestFirst EC2 instance termination policy when 2N
instances are InService
• Schedule AWS Lambda to own this responsibility everyday to
scale up and down
55. Using Lambda to scale up the Auto Scaling group
CloudWatch
Events -
Schedule
56. Using Lambda to scale up the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
57. Using Lambda to scale up the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate
ASG for
Scale UP
58. Using Lambda to scale up the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate
ASG for
Scale UP
Update
Reference Tag
on ASG
Abort & Exit
Failure
59. Using Lambda to scale up the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate
ASG for
Scale UP
Update
Reference Tag
on ASG
Scale up ASG
Abort & Exit
Failure
Failure
60. Using Lambda to scale up the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate
ASG for
Scale UP
Update
Reference Tag
on ASG
Scale up ASG
Notify & Exit
Abort & Exit
Failure
Failure
Failure
62. Using Lambda to scale down the Auto Scaling group
CloudWatch
Events -
Schedule
63. Using Lambda to scale down the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
64. Using Lambda to scale down the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate ASG
for Scale
DOWN
65. Using Lambda to scale down the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate ASG
for Scale
DOWN
Scale
DOWN ASG
Abort & Exit
Failure
66. Using Lambda to scale down the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate ASG
for Scale
DOWN
Scale
DOWN ASG
Remove the
tag from ASG
Abort & Exit
Failure
Failure
67. Using Lambda to scale down the Auto Scaling group
CloudWatch
Events -
Schedule
Amazon
Lambda
Validate ASG
for Scale
DOWN
Scale
DOWN ASG
Remove the
tag from ASG
Notify & Exit
Abort & Exit
Failure
Failure
Failure
70. Benefits of Serverless Computing
• Cost
• Operations
• Scale
• Opportunity
• Time to market
71. What’s next?
• Improve API Gateway integration in Lambda creation process
• Add support for logging to different sources other than
CloudWatch
• Process hotel images using Lambda