Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Things You Need to Know to Become a Serverless ...
Search
Allan Chua
August 20, 2020
1
760
Things You Need to Know to Become a Serverless API Ninja
Recommended list of things a cloud professional should know to become a Serverless API Ninja.
Allan Chua
August 20, 2020
Tweet
Share
More Decks by Allan Chua
See All by Allan Chua
Sneak Peek at Kali Linux
allanchua101
0
150
Node JS for Architects Part 1
allanchua101
0
290
Traditional, N-Tier & Microservices
allanchua101
0
86
Introduction to React
allanchua101
0
94
Ocelot Pluggable Gateway
allanchua101
0
1.4k
API Gateway in a Nutshell 2019
allanchua101
0
1.4k
JavaScript API Proxy Pattern
allanchua101
0
600
API Gateways - Dealing with Distributed Backends
allanchua101
0
150
API Gateways in a Nutshell
allanchua101
0
120
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
243
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Ruby is Unlike a Banana
tanoku
97
11k
Unsuck your backbone
ammeep
668
57k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Transcript
Things you need to know to become a Serverless API
Ninja Allan A. Chua API Days Singapore 2020
Writing a Book about Serverless Allan Chua Solutions & Integrations
Architect @ FWD AWS Certified Solution Architect Years of Experience with Serverless 1.5
BASICS INTEGRATIONS CAUTION
Serverless Means Efficiency
No Servers to Manage Pay only for what is used
Reduced Security Risk & Cost
Built-in High Availability & Disaster Recovery Availability Zone A Availability
Zone B Availability Zone C
What traditional architectures will cost you per API Cluster 1
EC2 t2.xlarge $0.185 / Hour 2 EC2 t2.xlarge $0.370 / Hour High Availability $135.05 $ 270.10
96K API calls worth 91 Hours of actual runtime for
71 CF Stacks in DEV environment for FREE
6.6 Million Queue Messages for 2$ In DEV Environment
We drove the cost of dev environments $270.10 per cluster
x 71 $ 19,710 $ 0 Lambda based architecture Traditional Architecture
Working with AWS Lambda is way more convenient with AUTOMATION
Reliable & Repeatable Builds Reduced Human Errors Maintainability Benefits of
Automation in API Development Protects businesses from developer turnover
` Shell Scripting • Deployment Automation (CI/CD) • Dependency Management
• Decommissioning • Validation Tasks
AWS SAM ✓ Definition of Serverless Resources ✓ Local testing
of functions ✓ Shorthand Syntax for Cloud Formation
Cloud Formation ✓ Definition of AWS resources ✓ Grouping of
AWS resources ✓ Base syntax used by SAM and other frameworks
Automation Sample Code ▪ Shell Scripts ▪ Install Dependencies ▪
Release API + Tables ▪ Decommissioning ▪ SAM Template ▪ API Gateway ▪ API Key ▪ Usage Plan ▪ Lambda APIs ▪ Cloud Formation ▪ Dynamo DBs
Have fun playing with the IAC trainers.
Serverless is not limited to Lambdas
The most common misconception about serverless is: Serverless = AWS
Lambda
Any AWS service that you don’t manage at the OS
level is serverless Database Queues File Buckets CI / CD Tools
The most popular AWS serverless services for building APIs DynamoDB
Lambda SQS X Ray API Gateway
AWS Lambda have a good amount of Integration Points
Tons of people are skeptical about Lambda’s integration capabilities.
Back in 2016 people are bashing lambda big time
But hey, it has been almost 5 years since 2016.
AWS Introduced cool integrations since
Basic CQRS using Lambda
CQRS & DynamoDB Streaming
Lambda Integrations https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html
Run shared code using Lambda Layers
Lambda-based APIs require each endpoint to be packaged in isolation
Which often leads to CODE DUPLICATION
Shared Code Dependencies Notorious Duplicates
To solve duplication issue: Use Lambda Layers
Benefits Centralized Dependencies Easier Code Updates Smaller Deployments
Sample API Implementation using Lambda Layers
Integrating vs Infusing Artificial Intelligence in your APIS
Digital Transformation have recently gained tons of traction and AI
is riding this wave
Lucky for us, we can either infuse or integrate AI
Models to Lambda APIs Integrating with AI APIs Infusing AI to your APIs
Integration with a base API powered by AI
Blog used for integrating Google Cloud Vision using NodeJS and
Lambda by Alex DeBrie https://www.serverless.com/blog/goog le-cloud-functions-application
Infusing / Packaging Custom Built AI Models to your APIs
An unorthodox approach on how can you achieve high accuracy
ML is by combining multiple models in an election system inside the API
How to embed Scikit Learn Models inside Lambda Functions by
Will High https://www.highonscience.com/blog/2 017/09/29/ml-scoring-service-on-aws- lambda/
Integrating RPA in your Serverless APIS
RPA is a huge advantage in the Insurtech World. Manual
Process Automation Data Scraping & Market Intelligence Integration with Legacy Systems
Typical Severless RPA Integration
Asynchronous API triggering RPA worker using AWS Lambda https://bit.ly/3kW9sTM
Serverless have Limitations
Its rewarding to be mindful about serverless limitations when proposing
to your boss
Memory Limitation Max Execution Time Invocation Payload Max Resource per
Cloud Formation Stack API Gateway Max REST Timeout 3 GB 6 MB 15 Mins 200 30 Secs
Wrestling with Coldstart
Common Causes of Coldstart Poor Choice of Language Too much
code Heavy Dependencies VPC Integration VPC
Coldstart Busters Use Lamba Layers Minimize VPC Keep Warm Pick
GO, JS and Python VPC
Serverless is NOT for everything
It can be rewarding to utilize Docker and K8s on
certain cases B2B Services On-Premise State Law vs Foreign Data Storage
Questions & Answers Section
Credits to the following: - Joel Khoo (Ninja Captain) -
Michel Do (Chatbot Master) - Nattavit Kamoltham (CI/CD & AI) - Jon Scheele for the invite
Searching Serverless Codebase is easier with Quod AI
Thanks for listening to my propositions