Upload
aws-germany
View
154
Download
0
Embed Size (px)
Citation preview
2
Agenda
• About Home24
• Our Journey to AWS and Serverless Architectures
• Use cases of Serverless Applications
• Caveats and Solutions
• Question and Answer Session
3
About home24
Europe's largest online only retailer for home furniture and living
Active in 7 countries, 5 different languages
100+ IT Employees
5
• The Best Shopping Application in 2015 in Germany
• Selected as Featured app many times by App Store
Available in IOS and Android
80000+ Monthly Active Users
Mobile applications
7
Endless stuff to deal with by 100+ people and 10+ teams
Order Processing
Business Intelligence Tools
Supporting Services for Customer Facing
Apps
Financial Tools
8
Home24 was launched with a modified
Magento software
MAGENTO
Monolithic PHP application on on-
premise infrastructure
OWN SOFTWARE
MICROSERVICE AND CLOUD
20152011 2013
Our technical journey
Switched to Microservice
architecture. Deprecated PHP: Every new project
in GO, JAVA and JS
Migrated to AWS
9
Why Microservices?
• Teams can choose the right tool for every service
• Every team can hold the ownership of a service
• Every team can manage its own infrastructure
Thus,
• Increases autonomy for teams
• Distributes the infrastructural risks
12
What is serverless?
• Every service managed by AWS
• Pay as you go. No need for 24/7 running infrastructure
• Less operation effort
• Focus on Dev of business requirements instead of Ops
15
Serverless Case Studies
• Parcel Service (Simple) – Our first attempt. Basic REST API
• Margin DB (Medium) – Responding to cloud events with zero custom infrastructure
• Voucher Manager (Expert) – Fully serverless application using Cognito and Lambda
17
Parcel Service
Stores delivery and packaging informationfor each product
Planned as new microservice to break themonolith
Less than 10000 requests per day
Response time of less than 100ms isrequired
20
Deployment options
Serverless framework
Cloudformation
Manually (Using CLI scripts or AWSConsole)
22
The Limitations
Number of supported languages arelimited. (We like GO more then Node!)
Container startup affects response times ofsome requests
SNI-Support required
API Gateway = public visible endpoint
23
The Wins
Pay only for usage(+ 1 million requests free per month)
API‘s can be secured with api keys
More memory = More CPU = Lower latency
Response times down to 30ms are possible
26
Margin DB
How much profit do we make per product?
More than 100.000 products with multiplevarieties
Daily recalculation
28
Cost
Service Usage Cost ($)
S3 170 GB-Mo 5.01
Lambda 39 million sec. 690
SNS 110 Millions Req. 45
SQS 232 Millions Req. 116
SWF 38000 0.79
EC2 0 Hours 0!
Note: usage and cost information are approximate.
Previous EC2 cost was 800$ but it was difficult to scale
30
Lets users store their vouchers in their mobile devices and use them in their purchases with 1-click
Lets us send new vouchers or remove old ones over the air
Voucher Manager
Project started with AWS
33
Cognito & Lambda
Stores user data in cloud with zero-backend
code
Support custom authentication as well as
social logins
Lambda hooks for more functionality
+
35
Case 1: Users add a voucher on mobile device
Nerdy LLDB output
Objective-C Code - Not for home use
Insanely easy implementation on mobile applicationOnly use AWS Cognito SDK
37
Case 2: Voucher data changes on Backend
We have an auxiliary DynamoDB tableto keep this relationship
39
Cost
Service Usage Cost ($)
API Gateway 2.1 million req. 7.57
Lambda 385000 seconds 6.19
Cognito Sync 344.410 Sync operations 5.17
Amazon EC2 0 Hours 0!
Note: usage and cost information are approximate. Negligible costs of SNS and DynamoDB are not included.
41
Tooling
• Native JAVA• Homemade deployment tools built by Gradle and Cloudformation
• Node.js• Serverless framework (Formerly JAWS)
43
AWS Lambda Problems and Solutions
Problem: Less control over server optimizations
Solution: It is natural. Still you can increase RAM and CPU usage
44
AWS Lambda Problems and Solutions
Problem: Lack of standard deployment tools
Solution: AWS is not providing any automatic deployment tool but there are open source solutions or it is easy to develop your own
45
AWS Lambda Problems and Solutions
Problem: Long cold start times. (Especially on JVM.)
Solution: Keep it warm. Invoke the function periodically using Route53 Health Check or Cloudwatch scheduled event
46
API Gateway Problems and Solutions
Problem: Slower than classical EC2-ELB stack
Solution: According to our experience, for many applications API Gateway’s performance is satisfying. But if you are developing a really low-latency service, API Gateway might not be the right solution at the moment
47
API Gateway Problems and Solutions
Problem: ACM support, GZIP compression and HTTP caching are missing
Solution: Put a Cloudfront distribution in front of API Gateway. With Cloudfront you can enable all these features
48
DynamoDB Problems and Solutions
Problem: Auto-scaling is missing
Solution: Use Dynamic DynamoDB or implement a custom Lambda autoscalingmechanism.
Fingers crossed for Autoscaling support from AWS
Dynamic DynamoDB available at: https://github.com/sebdah/dynamic-dynamodb
50
Selection criteria for Serverless
• Performance requirements
• Language/Framework requirements
• Scalability and High Availability Requirements
• Budget Constraints