2. Speak er Profile
1. Infrastructure Lead - Site Reliability Engineer at
Moka
2. Previous:
- Principal System Engineer - GDPLabs
3. victor.alexander@ mokapos.com
victoroloan@ gmail.com
3. Moka is a technology company providing
cloud-based Point-of-Sale and payment
solutions that empowers businesses to
better sell and grow. Moka is currently
present across 200+ cities in Indonesia
with over 30,000 merchants.
To Bring Business
Ecosystem to
Everyone
VISION
Empowering
Businesses
to Sell and Grow
MISSION
W hat is ?
4. Our Products
M oka P OS
Dashboard & Report
Sync Bill & Split Bill
Ingredient & Inventory
Loyalty Program
Table Management
and many more!
Moka Pay Moka Capital Moka Connect
5. Overview
W hat is Serverless
W hy Serverless
Cost and Ops Benefit
Sample Usage
Tips
6. W hat is Serverless ?
Serverless allows you to build and run applications and
services without thinking about servers.
- https://aws.amazon.com/serverless/
Google Cloud’s serverless platform lets you write code your
way without worrying about the underlying infrastructure.
- https://cloud.google.com/serverless
8. W hy Serverless?
No need to w orry about scaling
Less to m aintain (shift provision and scaling to
som eone else)
Pay only w hen it getting used (function call) rather
than pay for w hat has been provisioned, i.e EC2
9. W hen Serverless?
W rite Code, Ship It, Repeat
❏ Code size minimal
❏ Short-lived process
❏ Minimise cost for unused resources
❏ Deployment independently
❏ Fast Deployment
10. W hen Serverless?
If using cloud
● Fine with vendor lock-in (AW S, GCP, etc)
● Tightly coupled to cloud resources
○ API Gateway, S3, CloudW atch
OpenSource
● OpenFaaS
● Apache OpenW hisk
● Kubeless
12. Benefit - Cost
EC2 and LoadBalancer
2 instances (t3.m edium ) x 0.0528 USD x 730 hours in m onth = 77.09 USD (m onthly on Dem and cost)
Am azon EC2 On-Dem and inst ances (m ont hly): 77.09 USD
50 GB x 0.12 USD x 2 instances = 12.00 USD (EBS Storage Cost)
Am azon Elast ic Block St orage (EBS) pricing (m ont hly): 12.00 USD
1load balancers x 0.028 USD x 730 hours in a m onth = 20.44 USD
Classic Load Balancer fixed hourly charges (m ont hly): 20.44 USD
1classic load balancers x 100 GB total bytes processed per CLB x 0.008 per GB = 0.80 USD
Classic Load Balancer Dat a Processing charges (m ont hly): 0.80 USD
Tot al: 110.33 USD (m ont hly)
13. Benefit - Cost
Lambda - 15Mil / Month & 512MB Memory Allocation
Pricing calculations
RoundUp (500) = 500 Duration rounded to nearest 100ms
15,000,000 requests x 500 ms x 0.001 ms to sec conversion factor = 7,500,000.00 total compute (seconds)
0.50 GB x 7,500,000.00 seconds = 3,750,000.00 total compute (GB-s)
3,750,000.00 GB-s - 400000 free tier GB-s = 3,350,000.00 GB-s
Max (3350000.00 GB-s, 0 ) = 3,350,000.00 total billable GB-s
3,350,000.00 GB-s x 0.0000166667 USD = 55.83 USD (monthly compute charges)
15,000,000 requests - 1000000 free tier requests = 14,000,000 monthly billable requests
Max (14000000 monthly billable requests, 0 ) = 14,000,000.00 total monthly billable requests
14,000,000.00 total monthly billable requests x 0.0000002 USD = 2.80 USD (monthly request charges)
55.83 USD + 2.80 USD = 58.63 USD
Lam bda cost s - W it h Free Tier (m ont hly): 58.63 USD