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
770
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
160
Node JS for Architects Part 1
allanchua101
0
290
Traditional, N-Tier & Microservices
allanchua101
0
90
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
160
API Gateways in a Nutshell
allanchua101
0
130
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Faster Mobile Websites
deanohume
305
30k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Visualization
eitanlees
146
15k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Code Reviewing Like a Champion
maltzj
520
39k
The World Runs on Bad Software
bkeepers
PRO
65
11k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Typedesign – Prime Four
hannesfritz
40
2.4k
Into the Great Unknown - MozCon
thekraken
33
1.5k
How to Ace a Technical Interview
jacobian
276
23k
Building Adaptive Systems
keathley
38
2.3k
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