Download - The Journey to Serverless
![Page 1: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/1.jpg)
1
The Journey to ServerlessÇağatay Gürtürk, Martin Lindenberg Software Engineering, Home24 AG
![Page 2: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/2.jpg)
2
Agenda
• About Home24
• Our Journey to AWS and Serverless Architectures
• Use cases of Serverless Applications
• Caveats and Solutions
• Question and Answer Session
![Page 3: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/3.jpg)
3
About home24
Europe's largest online only retailer for home furniture and living
Active in 7 countries, 5 different languages
100+ IT Employees
![Page 4: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/4.jpg)
4
Desktop website
4.2 million visitors per month23 millions page views per month
![Page 5: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/5.jpg)
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
![Page 6: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/6.jpg)
6
There is always an invisible part of the
Iceberg.
![Page 7: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/7.jpg)
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
![Page 8: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/8.jpg)
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
![Page 9: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/9.jpg)
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
![Page 10: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/10.jpg)
10
AWS Migration
Not only a provider change, but a mindset change
![Page 11: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/11.jpg)
11
Why AWS?
• Cost efficient
• Scalable
• Requires less operation effort
![Page 12: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/12.jpg)
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
![Page 13: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/13.jpg)
13
On-Premise Serverless
Not only Lambda but…
And more services…
![Page 14: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/14.jpg)
14
Case Studies
![Page 15: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/15.jpg)
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
![Page 16: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/16.jpg)
16
Parcel Service
![Page 17: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/17.jpg)
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
![Page 18: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/18.jpg)
18
Previous stack for new microservices
![Page 19: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/19.jpg)
19
Serverless stack
API Gateway
![Page 20: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/20.jpg)
20
Deployment options
Serverless framework
Cloudformation
Manually (Using CLI scripts or AWSConsole)
![Page 21: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/21.jpg)
21
Serverless stack
![Page 22: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/22.jpg)
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
![Page 23: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/23.jpg)
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
![Page 24: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/24.jpg)
24
Price comparison
![Page 25: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/25.jpg)
25
Margin DB
![Page 26: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/26.jpg)
26
Margin DB
How much profit do we make per product?
More than 100.000 products with multiplevarieties
Daily recalculation
![Page 27: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/27.jpg)
27
Margin DB: event based workers
![Page 28: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/28.jpg)
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
![Page 29: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/29.jpg)
29
Voucher Manager
![Page 30: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/30.jpg)
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
![Page 31: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/31.jpg)
31
Voucher Manager
![Page 32: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/32.jpg)
32
Voucher Manager
![Page 33: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/33.jpg)
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
+
![Page 34: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/34.jpg)
34
Case 1: Users add a voucher on mobile device
![Page 35: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/35.jpg)
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
![Page 36: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/36.jpg)
36
Case 1: Users add a voucher on mobile device
![Page 37: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/37.jpg)
37
Case 2: Voucher data changes on Backend
We have an auxiliary DynamoDB tableto keep this relationship
![Page 38: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/38.jpg)
38
Case 3: Add Voucher from other channels
![Page 39: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/39.jpg)
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.
![Page 40: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/40.jpg)
40
How we build?
![Page 41: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/41.jpg)
41
Tooling
• Native JAVA• Homemade deployment tools built by Gradle and Cloudformation
• Node.js• Serverless framework (Formerly JAWS)
![Page 42: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/42.jpg)
42
Problems and Solutions
Encountered problems, fixed and addressed ones
![Page 43: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/43.jpg)
43
AWS Lambda Problems and Solutions
Problem: Less control over server optimizations
Solution: It is natural. Still you can increase RAM and CPU usage
![Page 44: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/44.jpg)
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
![Page 45: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/45.jpg)
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
![Page 46: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/46.jpg)
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
![Page 47: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/47.jpg)
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
![Page 48: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/48.jpg)
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
![Page 49: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/49.jpg)
49
Future
Running the whole platform without EC2 Instances
![Page 50: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/50.jpg)
50
Selection criteria for Serverless
• Performance requirements
• Language/Framework requirements
• Scalability and High Availability Requirements
• Budget Constraints
![Page 51: The Journey to Serverless](https://reader033.vdocuments.site/reader033/viewer/2022051319/58a2ea911a28abe1338b927d/html5/thumbnails/51.jpg)
51
QUESTIONS & ANSWERS SESSION