SlideShare una empresa de Scribd logo
1 de 36
Srini Karlekar – Director, Software Engineering, Capital
One.
Twitter: @skarlekar
 Serverless Architectures are those models where the applications logic provided by
the Developer is run on stateless, compute containers that are provisioned and
managed by a provider.
 Typically these compute instances are ephemeral (short-lived for the duration of
the request-response cycle), typically runs a function and triggered through an
event.
 Due to the on-demand provisioning nature of this architecture, the systems built
using Serverless technologies are inherently scalable and highly responsive under
load.
2
 The introduction of function PaaS1 (fPaaS) as Lambda by Amazon in re:Invent,
Nov 2014 (and out of beta in late 2015) created a momentum for "serverless"
platform architecture. AWS Lambda was soon followed by most major cloud
platform vendors, including IBM, Microsoft, Google and, more recently, Oracle.
Serverless is a cloud-native platform model.
 Per Gartner, by 2022 most cloud architectures will evolve to a fundamentally
serverless model rendering the cloud platform architectures dominating in 2017
as legacy architectures2.
 Serverless is a cloud-native platform model and reflects the core-promise of cloud-
computing by offering agility and capability on demand at a value price.
3
1. Platform as a Service.
2. The Key Trends in PaaS, 2017 - Published: 31 January 2017 ID: G00313016
 Serverless computing model is an emerging trend and quite often misunderstood
because of the hype and build-up surrounding the topic.
 The term Serverless refers to building applications without having to configure or
maintain infrastructure required for running your applications on the cloud.
 In reality, servers are still involved, though they are owned and controlled by the
platform providers.
 On the other hand there are frameworks used for exploiting the serverless
architecture uninspiringly named Serverless Framework increasing the confusion.
4
5
 FaaS - The technique of building applications
using Serverless architecture.
 Cost Efficiency – Pay per execution model is most
efficient at managing costs.
 Ephemeral – Short-lived process triggered via
event.
 Auto-scaling – Compute resources are provisioned
granularly per request.
 Event-driven – Functions respond to events such
as http, file drop, alerts, timer, topics etc
 Microservices – Modules built to satisfy a specific
goal and uses a simple, well-defined interface.
6
 State - Due to the ephemeral nature of the FaaS architecture, the state of
your application should be managed externally from the FaaS
infrastructure or off-loaded to a cache or data-base.
 Duration - Because of the on-demand provisioning and low-cost nature of
the FaaS solution there is a restriction on how long your functions are
allowed to run. To keep the price low - as you are billed by minutes of
usage, some providers such as Amazon AWS and Microsoft Azure restrict
the duration of time a function is allowed to process a request.
7
 Deployment & Resource Limits - Some providers such as AWS
have deployment limits on the size of the deployment package, code
and libraries that can be deployed in the package.
 This could be severely limiting for some applications such as image
processing functions that depend on large libraries that have to be
packaged along with the code.
 Additionally, there are limits on the number of concurrent function
executions, ephemeral disk capacity (temp space) etc.
 While some of these limits are soft limits and can be reconfigured
per function by working with the providers, others are hard limits
and will force you to reevaluate the choice of your design.
8
 Latency - Due to the on-demand provisioning nature of the
FaaS infrastructure, applications that uses languages such
as Java/Scala that require a longer start time to spin up
JVMs may encounter longer runtime.
 Having said that, providers optimize the infrastructure spin-
ups based on the usage patterns of the functions.
 On the other hand, due to the interpreted nature of Python
and Javascript, functions written in these languages may
not see a significant difference in latency between a PaaS
and FaaS offering.
9
While there are new providers entering the market to exploit the Serverless wave,
the following rule the roost:
 Amazon with its AWS Lambda,
 Microsoft with its Azure Functions,
 Google with its Google Functions and
 IBM with its Openwhisk.
10
 Getting Started with Serverless Computing on AWS -
https://cloudacademy.com/learning-paths/getting-started-serverless-computing-25/
 Serverless Computing on AWS for Developers -
https://cloudacademy.com/learning-paths/serverless-computing-aws-developers-45/
 Serverless Workshop - https://cloudacademy.com/learning-paths/serverless-
workshop-64/
11
12
http://bit.ly/2qArW04
13
 Organizations want to diversify risk and hence do not want to be bound to
a single provider.
 While not having to manage infrastructure by using serverless functions is
nice, having to deal with hundreds of functions in a project between
multiple providers, managing buckets, messaging and permissions
becomes an issue in itself.
 While many providers are entering into the Serverless field to make
developing cloud-native applications easy, you are still bound to
idiosyncrasies of the provider when it comes to their FaaS offering.
 Not only do you have to learn the different terminologies used by the
various providers, you will have to learn how to use their offerings on their
respective consoles or CLI (Command Line Interface).
14
 The Serverless Framework is an MIT open-source project, actively
maintained by a vibrant and engaged community of developers and
provides robust plugins for various FaaS providers and allows to extend it
when needed.
 The Serverless Framework allows you to provision and deploy REST APIs,
backend services, data pipe-lines, and other uses cases by providing a
framework and CLI to build serverless services across many providers by
abstracting away provider-level complexity.
 The Serverless Framework is different than other application frameworks
because:
 It manages your code as well as your infrastructure
 It supports multiple languages (Node.js, Python, Java, and more)
15
Serverless Framework consists of the following core concepts:
Service
Function
Events
Resources
Plugins
16
Service - The unit of organization. It's where you define your Functions, the
Events that trigger them, and the Resources your Functions use, all in one
file titled serverless.yml. More information at: https://goo.gl/9SKBvx
An application can have multiple services and hence multiple serverless.yml
files.
17
Functions - A Function is an independent unit of deployment or
microservice. It manifests itself as a Lambda or Azure Function depending
upon the provider. It's merely code, deployed in the cloud, that is most often
written to perform a single job such as:
 Saving a user to the database
 Processing a file in a database
 Performing a scheduled task
18
Anything that triggers an Function to execute is regarded by the
Framework as an Event.
Events on AWS are:
 An AWS API Gateway HTTP endpoint request (e.g., for a REST API)
 An AWS S3 bucket upload (e.g., for an image)
 A CloudWatch timer (e.g., run every 5 minutes)
 An AWS SNS topic (e.g., a message)
 A CloudWatch Alert (e.g., something happened)
When you define an event for your functions in the Serverless Framework,
the Framework will automatically create any infrastructure necessary for
that event (e.g., an API Gateway endpoint) and configure your Functions to
listen to it.
19
Simply put, events are the things that trigger your functions to run. If you
are using AWS as your provider, all events in the service are anything in
AWS that can trigger an AWS Lambda function, like an S3 bucket upload,
an SNS topic, and HTTP endpoints created via API Gateway.
Upon deployment, the framework will deploy any infrastructure required for
an event (e.g., an API Gateway endpoint) and configure your function to
listen to it.
20
Resources are infrastructure components which your Functions uses.
If you use AWS as you provider, then resources are:
 An AWS DynamoDB Table (e.g., for saving Users/Posts/Comments data)
 An AWS S3 Bucket (e.g., for saving images or files)
 An AWS SNS Topic (e.g., for sending messages asynchronously)
Anything that can be defined in CloudFormation is supported by the
Serverless Framework
The Serverless Framework not only deploys your Functions and the Events
that trigger them, but it also deploys the infrastructure components your
Functions depend upon.
21
22
An example of resources in Serverless Framework using AWS as provider:
23
Serverless Framework needs access to your cloud provider account
credentials to deploy resources on your behalf. For AWS you can use AWS
CLI (aws configure). Azure is more involved.
Following links provide excellent guidance on setting up the credentials for
various providers currently supported on the Serverless Framework.
AWS -
https://serverless.com/framework/docs/providers/aws/guide/credentials/
Azure -
https://serverless.com/framework/docs/providers/azure/guide/credentials/
Openwhisk -
https://serverless.com/framework/docs/providers/openwhisk/guide/credential
s/
24
Serverless Framework translates the service declaration in the
serverless.yml file into a Cloud Formation or Resource Manager template
depending upon the provider you choose.
To deploy your service, all the functions and provision the resources, enter:
serverless deploy --verbose
To deploy a single function after making changes to it, enter:
serverless deploy function --function <myfunction> --verbose
25
Serverless Framework allows you to invoke a function locally for testing or
invoke a deployed function.
To invoke your function locally, enter:
serverless invoke local --function <myfunction> --log
To invoke a deployed function, enter:
serverless invoke function --function <myfunction> --stage <my
stage> --region <myregion>
Note: If you omit the stage and region option, the default stage (dev) and
region specified in your provider configuration will be used.
26
27
28
29
30
31
A celebrity face recognition service built with Serverless
Framework using Twilio, Amazon Rekognition and IMDbPy API.
The CelebritySleuth application is an event-driven application taking advantage
of:
 The user's mobile SMS/MMS for the presentation tier,
 Twilio in the middle-tier to bridge the SMS world and
 AWS Gateway and a set of AWS Lambda functions written in Python making use
of AWS Rekogniton for image processing and IMDB for gathering information on
the celebrities.
CelebritySleuth code repository, installation guide and usage at:
https://github.com/skarlekar/faces
32
To begin with you have to train the application to recognize the faces by
building a collection of celebrities. You do this by sending a random sample
of celebrity pictures (image URLs) and their corresponding names. The
more pictures of a celebrity, the more accurate the recognition will be.
The CelebritySleuth application consists of two services:
 Twilio Communication Service
 Face Recognition Service
The services are decoupled to allow for using different presentation tiers in
future.
33
34
1.USER SENDS A PICTURE AND COMMANDS TO
ADD/MATCH FACE TO A COLLECTION. THE
SMS/MMS IS SENT TO A TELEPHONE
NUMBER HOSTED BY TWILIO.
2.TWILIO INTERCEPTS THE MESSAGE AND
FORWARDS IT TO AN API GATEWAY BASED
ON THE USER’S TWILIO CONFIGURATION.
3.API GATEWAY TRANSLATES TWIML TO
JSON AND CALLS THE REQUEST
PROCESSOR LAMBDA FUNCTION.
4.THE REQUEST PROCESSOR LAMBDA
VALIDATES THE COMMANDS AND PUT A
MESSAGE TO THE APPROPRIATE TOPIC ON
SNS. IF THE VALIDATION FAILS, IT
RETURNS THE ERROR MESSAGE TO THE
USER VIA TWILIO.
5. WHEN A MESSAGE ARRIVES IN THE CREATE
COLLECTION TOPIC, A LAMBDA IS
TRIGGERED WHICH ADDS THE NAMED
COLLECTION IN AWS REKOGNITION VIA
BOTO LIBRARIES. A SUCCESS/ERROR
MESSAGE IS PUT IN THE RESPONSE
PROCESSOR TOPIC.
6.WHEN A MESSAGE ARRIVES IN ADD FACE
TOPIC, A LAMBDA IS TRIGGERED WHICH
IDENTIFIES THE MOST PROMINENT FACE IN
THE IMAGE AND ADDS THE METADATA FOR
THE FACE TO THE GIVEN COLLECTION. IF
THERE IS NO FACES IDENTIFIED, IT
CREATES AN ERROR MESSAGE AND SENDS
THE RESPONSE TO THE RESPONSE
PROCESSOR TOPIC.
7. WHEN A MESSAGE ARRIVES IN MATCH
FACE TOPIC, A LAMBDA IS TRIGGERED
WHICH IDENTIFIES THE MOST PROMINENT
FACE IN THE IMAGE AND MATCHES THE
METADATA FOR THAT FACE WITH KNOWN
FACES IN THE COLLECTION. IF A MATCH IS
FOUND, THE CORRESPONDING PERSON’S
NAME IS RETURNED. THE LAMBDA THEN
USES IMDB TO LOOKUP THE BIOGRAPHY
OF THE PERSON.
8. THE VARIOUS LAMBDA-BASED PROCESSORS
DROPS THE RESPONSE MESSAGE ON THE
RESPONSE PROCESSOR TOPIC.
9. THE RESPONSE PROCESSOR PICKS UP THE
RESPONSE AND CONSTRUCTS A SMS
MESSAGE AND CALLS TWILIO’S SMS
SERVICE.
10.TWILIO VALIDATES THE FROM NUMBER
AND SENDS THE MESSAGE TO THE
CORRESPONDING TO NUMBER.
35
The CelebritySleuth application can be cloned from:
https://github.com/skarlekar/faces
The two main services are:
Twilio Communication Service -
https://github.com/skarlekar/faces/tree/master/twilioCommunicationService
Face Recognition Service –
https://github.com/skarlekar/faces/tree/master/faceRecognitionService
36
Security – Wrap a security blanket around twilioCommunicationService
such that only authorized users are allowed to call the service. More
information at: https://www.twilio.com/docs/api/security#http-authentication
Validation – In addition to the security blanket above, validate that the
twilioCommunicationService is called only from Twilio. More information at:
https://www.twilio.com/docs/api/security#validating-requests
VPC – As the faceRecognitionService is an internal service, secure it within
a VPC. More information at:
https://serverless.com/framework/docs/providers/aws/guide/functions#vpc-
configuration

Más contenido relacionado

La actualidad más candente

AWS S3 and GLACIER
AWS S3 and GLACIERAWS S3 and GLACIER
AWS S3 and GLACIERMahesh Raj
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerAmazon Web Services
 
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019 Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019 Amazon Web Services
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSAmazon Web Services
 
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트) IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트) Amazon Web Services Korea
 
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)Amazon Web Services
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatchAmazon Web Services
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudNew Relic
 
Cloud computing and migration strategies to cloud
Cloud computing and migration strategies to cloudCloud computing and migration strategies to cloud
Cloud computing and migration strategies to cloudSourabh Saxena
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech TalkAmazon Web Services
 
(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep DiveAmazon Web Services
 
Implementing your landing zone - FND210 - AWS re:Inforce 2019
Implementing your landing zone - FND210 - AWS re:Inforce 2019 Implementing your landing zone - FND210 - AWS re:Inforce 2019
Implementing your landing zone - FND210 - AWS re:Inforce 2019 Amazon Web Services
 

La actualidad más candente (20)

AWS S3 and GLACIER
AWS S3 and GLACIERAWS S3 and GLACIER
AWS S3 and GLACIER
 
Serverless computing
Serverless computingServerless computing
Serverless computing
 
Introduction to AWS Secrets Manager
Introduction to AWS Secrets ManagerIntroduction to AWS Secrets Manager
Introduction to AWS Secrets Manager
 
Introduction to Amazon EKS
Introduction to Amazon EKSIntroduction to Amazon EKS
Introduction to Amazon EKS
 
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019 Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKS
 
EKS Workshop
 EKS Workshop EKS Workshop
EKS Workshop
 
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트) IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
 
AWS for Backup and Recovery
AWS for Backup and RecoveryAWS for Backup and Recovery
AWS for Backup and Recovery
 
Security & Compliance in AWS
Security & Compliance in AWSSecurity & Compliance in AWS
Security & Compliance in AWS
 
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
 
Aws101
Aws101Aws101
Aws101
 
Amazon Cognito Deep Dive
Amazon Cognito Deep DiveAmazon Cognito Deep Dive
Amazon Cognito Deep Dive
 
Cloud computing and migration strategies to cloud
Cloud computing and migration strategies to cloudCloud computing and migration strategies to cloud
Cloud computing and migration strategies to cloud
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
 
(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive
 
Azure fundamentals
Azure fundamentalsAzure fundamentals
Azure fundamentals
 
Implementing your landing zone - FND210 - AWS re:Inforce 2019
Implementing your landing zone - FND210 - AWS re:Inforce 2019 Implementing your landing zone - FND210 - AWS re:Inforce 2019
Implementing your landing zone - FND210 - AWS re:Inforce 2019
 

Similar a Building Serverless Microservices Using Serverless Framework on the Cloud

Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...
Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...
Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...Srini Karlekar
 
Service Models
Service ModelsService Models
Service ModelsAllwyn24
 
Aws interview questions and answers
Aws interview questions and answersAws interview questions and answers
Aws interview questions and answerskavinilavuG
 
AWS Interview Questions and Answers -CREDO SYSTEMZ.pdf
AWS Interview Questions and Answers -CREDO SYSTEMZ.pdfAWS Interview Questions and Answers -CREDO SYSTEMZ.pdf
AWS Interview Questions and Answers -CREDO SYSTEMZ.pdfnishajeni1
 
Cloud computing
Cloud computingCloud computing
Cloud computinggd1410
 
When to use serverless computing.pdf
When to use serverless computing.pdfWhen to use serverless computing.pdf
When to use serverless computing.pdfSGBSeo
 
When to use serverless computing.pdf
When to use serverless computing.pdfWhen to use serverless computing.pdf
When to use serverless computing.pdfseo18
 
AWS Serverless Introduction (Lambda)
AWS Serverless Introduction (Lambda)AWS Serverless Introduction (Lambda)
AWS Serverless Introduction (Lambda)Ashish Kushwaha
 
Testing of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService CloudTesting of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService CloudRustam Zeynalov
 
Aws serverless multi-tier_architectures
Aws serverless multi-tier_architecturesAws serverless multi-tier_architectures
Aws serverless multi-tier_architecturessonpro2312
 
AWS Lambda Documentation
AWS Lambda DocumentationAWS Lambda Documentation
AWS Lambda DocumentationWhizlabs
 
Comparative Study of Various Platform as a Service Frameworks
Comparative Study of Various Platform as a Service Frameworks Comparative Study of Various Platform as a Service Frameworks
Comparative Study of Various Platform as a Service Frameworks neirew J
 
COMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKS
COMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKSCOMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKS
COMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKSijccsa
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseAraf Karsh Hamid
 

Similar a Building Serverless Microservices Using Serverless Framework on the Cloud (20)

Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...
Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...
Building Cross-Cloud Platform Cognitive Microservices Using Serverless Archit...
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
Service Models
Service ModelsService Models
Service Models
 
Aws interview questions and answers
Aws interview questions and answersAws interview questions and answers
Aws interview questions and answers
 
Demistifying serverless on aws
Demistifying serverless on awsDemistifying serverless on aws
Demistifying serverless on aws
 
Serverless Architectures
Serverless Architectures Serverless Architectures
Serverless Architectures
 
AWS Interview Questions and Answers -CREDO SYSTEMZ.pdf
AWS Interview Questions and Answers -CREDO SYSTEMZ.pdfAWS Interview Questions and Answers -CREDO SYSTEMZ.pdf
AWS Interview Questions and Answers -CREDO SYSTEMZ.pdf
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
When to use serverless computing.pdf
When to use serverless computing.pdfWhen to use serverless computing.pdf
When to use serverless computing.pdf
 
When to use serverless computing.pdf
When to use serverless computing.pdfWhen to use serverless computing.pdf
When to use serverless computing.pdf
 
Module 3-cloud computing
Module 3-cloud computingModule 3-cloud computing
Module 3-cloud computing
 
AWS Serverless Introduction (Lambda)
AWS Serverless Introduction (Lambda)AWS Serverless Introduction (Lambda)
AWS Serverless Introduction (Lambda)
 
Testing of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService CloudTesting of Serverless Application on Amazon WebService Cloud
Testing of Serverless Application on Amazon WebService Cloud
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Aws serverless multi-tier_architectures
Aws serverless multi-tier_architecturesAws serverless multi-tier_architectures
Aws serverless multi-tier_architectures
 
AWS Lambda Documentation
AWS Lambda DocumentationAWS Lambda Documentation
AWS Lambda Documentation
 
Comparative Study of Various Platform as a Service Frameworks
Comparative Study of Various Platform as a Service Frameworks Comparative Study of Various Platform as a Service Frameworks
Comparative Study of Various Platform as a Service Frameworks
 
COMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKS
COMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKSCOMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKS
COMPARATIVE STUDY OF VARIOUS PLATFORM AS A SERVICE FRAMEWORKS
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-Premise
 
Serverless architecture
Serverless architectureServerless architecture
Serverless architecture
 

Último

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Último (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Building Serverless Microservices Using Serverless Framework on the Cloud

  • 1. Srini Karlekar – Director, Software Engineering, Capital One. Twitter: @skarlekar
  • 2.  Serverless Architectures are those models where the applications logic provided by the Developer is run on stateless, compute containers that are provisioned and managed by a provider.  Typically these compute instances are ephemeral (short-lived for the duration of the request-response cycle), typically runs a function and triggered through an event.  Due to the on-demand provisioning nature of this architecture, the systems built using Serverless technologies are inherently scalable and highly responsive under load. 2
  • 3.  The introduction of function PaaS1 (fPaaS) as Lambda by Amazon in re:Invent, Nov 2014 (and out of beta in late 2015) created a momentum for "serverless" platform architecture. AWS Lambda was soon followed by most major cloud platform vendors, including IBM, Microsoft, Google and, more recently, Oracle. Serverless is a cloud-native platform model.  Per Gartner, by 2022 most cloud architectures will evolve to a fundamentally serverless model rendering the cloud platform architectures dominating in 2017 as legacy architectures2.  Serverless is a cloud-native platform model and reflects the core-promise of cloud- computing by offering agility and capability on demand at a value price. 3 1. Platform as a Service. 2. The Key Trends in PaaS, 2017 - Published: 31 January 2017 ID: G00313016
  • 4.  Serverless computing model is an emerging trend and quite often misunderstood because of the hype and build-up surrounding the topic.  The term Serverless refers to building applications without having to configure or maintain infrastructure required for running your applications on the cloud.  In reality, servers are still involved, though they are owned and controlled by the platform providers.  On the other hand there are frameworks used for exploiting the serverless architecture uninspiringly named Serverless Framework increasing the confusion. 4
  • 5. 5
  • 6.  FaaS - The technique of building applications using Serverless architecture.  Cost Efficiency – Pay per execution model is most efficient at managing costs.  Ephemeral – Short-lived process triggered via event.  Auto-scaling – Compute resources are provisioned granularly per request.  Event-driven – Functions respond to events such as http, file drop, alerts, timer, topics etc  Microservices – Modules built to satisfy a specific goal and uses a simple, well-defined interface. 6
  • 7.  State - Due to the ephemeral nature of the FaaS architecture, the state of your application should be managed externally from the FaaS infrastructure or off-loaded to a cache or data-base.  Duration - Because of the on-demand provisioning and low-cost nature of the FaaS solution there is a restriction on how long your functions are allowed to run. To keep the price low - as you are billed by minutes of usage, some providers such as Amazon AWS and Microsoft Azure restrict the duration of time a function is allowed to process a request. 7
  • 8.  Deployment & Resource Limits - Some providers such as AWS have deployment limits on the size of the deployment package, code and libraries that can be deployed in the package.  This could be severely limiting for some applications such as image processing functions that depend on large libraries that have to be packaged along with the code.  Additionally, there are limits on the number of concurrent function executions, ephemeral disk capacity (temp space) etc.  While some of these limits are soft limits and can be reconfigured per function by working with the providers, others are hard limits and will force you to reevaluate the choice of your design. 8
  • 9.  Latency - Due to the on-demand provisioning nature of the FaaS infrastructure, applications that uses languages such as Java/Scala that require a longer start time to spin up JVMs may encounter longer runtime.  Having said that, providers optimize the infrastructure spin- ups based on the usage patterns of the functions.  On the other hand, due to the interpreted nature of Python and Javascript, functions written in these languages may not see a significant difference in latency between a PaaS and FaaS offering. 9
  • 10. While there are new providers entering the market to exploit the Serverless wave, the following rule the roost:  Amazon with its AWS Lambda,  Microsoft with its Azure Functions,  Google with its Google Functions and  IBM with its Openwhisk. 10
  • 11.  Getting Started with Serverless Computing on AWS - https://cloudacademy.com/learning-paths/getting-started-serverless-computing-25/  Serverless Computing on AWS for Developers - https://cloudacademy.com/learning-paths/serverless-computing-aws-developers-45/  Serverless Workshop - https://cloudacademy.com/learning-paths/serverless- workshop-64/ 11
  • 13. 13
  • 14.  Organizations want to diversify risk and hence do not want to be bound to a single provider.  While not having to manage infrastructure by using serverless functions is nice, having to deal with hundreds of functions in a project between multiple providers, managing buckets, messaging and permissions becomes an issue in itself.  While many providers are entering into the Serverless field to make developing cloud-native applications easy, you are still bound to idiosyncrasies of the provider when it comes to their FaaS offering.  Not only do you have to learn the different terminologies used by the various providers, you will have to learn how to use their offerings on their respective consoles or CLI (Command Line Interface). 14
  • 15.  The Serverless Framework is an MIT open-source project, actively maintained by a vibrant and engaged community of developers and provides robust plugins for various FaaS providers and allows to extend it when needed.  The Serverless Framework allows you to provision and deploy REST APIs, backend services, data pipe-lines, and other uses cases by providing a framework and CLI to build serverless services across many providers by abstracting away provider-level complexity.  The Serverless Framework is different than other application frameworks because:  It manages your code as well as your infrastructure  It supports multiple languages (Node.js, Python, Java, and more) 15
  • 16. Serverless Framework consists of the following core concepts: Service Function Events Resources Plugins 16
  • 17. Service - The unit of organization. It's where you define your Functions, the Events that trigger them, and the Resources your Functions use, all in one file titled serverless.yml. More information at: https://goo.gl/9SKBvx An application can have multiple services and hence multiple serverless.yml files. 17
  • 18. Functions - A Function is an independent unit of deployment or microservice. It manifests itself as a Lambda or Azure Function depending upon the provider. It's merely code, deployed in the cloud, that is most often written to perform a single job such as:  Saving a user to the database  Processing a file in a database  Performing a scheduled task 18
  • 19. Anything that triggers an Function to execute is regarded by the Framework as an Event. Events on AWS are:  An AWS API Gateway HTTP endpoint request (e.g., for a REST API)  An AWS S3 bucket upload (e.g., for an image)  A CloudWatch timer (e.g., run every 5 minutes)  An AWS SNS topic (e.g., a message)  A CloudWatch Alert (e.g., something happened) When you define an event for your functions in the Serverless Framework, the Framework will automatically create any infrastructure necessary for that event (e.g., an API Gateway endpoint) and configure your Functions to listen to it. 19
  • 20. Simply put, events are the things that trigger your functions to run. If you are using AWS as your provider, all events in the service are anything in AWS that can trigger an AWS Lambda function, like an S3 bucket upload, an SNS topic, and HTTP endpoints created via API Gateway. Upon deployment, the framework will deploy any infrastructure required for an event (e.g., an API Gateway endpoint) and configure your function to listen to it. 20
  • 21. Resources are infrastructure components which your Functions uses. If you use AWS as you provider, then resources are:  An AWS DynamoDB Table (e.g., for saving Users/Posts/Comments data)  An AWS S3 Bucket (e.g., for saving images or files)  An AWS SNS Topic (e.g., for sending messages asynchronously) Anything that can be defined in CloudFormation is supported by the Serverless Framework The Serverless Framework not only deploys your Functions and the Events that trigger them, but it also deploys the infrastructure components your Functions depend upon. 21
  • 22. 22 An example of resources in Serverless Framework using AWS as provider:
  • 23. 23 Serverless Framework needs access to your cloud provider account credentials to deploy resources on your behalf. For AWS you can use AWS CLI (aws configure). Azure is more involved. Following links provide excellent guidance on setting up the credentials for various providers currently supported on the Serverless Framework. AWS - https://serverless.com/framework/docs/providers/aws/guide/credentials/ Azure - https://serverless.com/framework/docs/providers/azure/guide/credentials/ Openwhisk - https://serverless.com/framework/docs/providers/openwhisk/guide/credential s/
  • 24. 24 Serverless Framework translates the service declaration in the serverless.yml file into a Cloud Formation or Resource Manager template depending upon the provider you choose. To deploy your service, all the functions and provision the resources, enter: serverless deploy --verbose To deploy a single function after making changes to it, enter: serverless deploy function --function <myfunction> --verbose
  • 25. 25 Serverless Framework allows you to invoke a function locally for testing or invoke a deployed function. To invoke your function locally, enter: serverless invoke local --function <myfunction> --log To invoke a deployed function, enter: serverless invoke function --function <myfunction> --stage <my stage> --region <myregion> Note: If you omit the stage and region option, the default stage (dev) and region specified in your provider configuration will be used.
  • 26. 26
  • 27. 27
  • 28. 28
  • 29. 29
  • 30. 30
  • 31. 31 A celebrity face recognition service built with Serverless Framework using Twilio, Amazon Rekognition and IMDbPy API. The CelebritySleuth application is an event-driven application taking advantage of:  The user's mobile SMS/MMS for the presentation tier,  Twilio in the middle-tier to bridge the SMS world and  AWS Gateway and a set of AWS Lambda functions written in Python making use of AWS Rekogniton for image processing and IMDB for gathering information on the celebrities. CelebritySleuth code repository, installation guide and usage at: https://github.com/skarlekar/faces
  • 32. 32 To begin with you have to train the application to recognize the faces by building a collection of celebrities. You do this by sending a random sample of celebrity pictures (image URLs) and their corresponding names. The more pictures of a celebrity, the more accurate the recognition will be. The CelebritySleuth application consists of two services:  Twilio Communication Service  Face Recognition Service The services are decoupled to allow for using different presentation tiers in future.
  • 33. 33
  • 34. 34 1.USER SENDS A PICTURE AND COMMANDS TO ADD/MATCH FACE TO A COLLECTION. THE SMS/MMS IS SENT TO A TELEPHONE NUMBER HOSTED BY TWILIO. 2.TWILIO INTERCEPTS THE MESSAGE AND FORWARDS IT TO AN API GATEWAY BASED ON THE USER’S TWILIO CONFIGURATION. 3.API GATEWAY TRANSLATES TWIML TO JSON AND CALLS THE REQUEST PROCESSOR LAMBDA FUNCTION. 4.THE REQUEST PROCESSOR LAMBDA VALIDATES THE COMMANDS AND PUT A MESSAGE TO THE APPROPRIATE TOPIC ON SNS. IF THE VALIDATION FAILS, IT RETURNS THE ERROR MESSAGE TO THE USER VIA TWILIO. 5. WHEN A MESSAGE ARRIVES IN THE CREATE COLLECTION TOPIC, A LAMBDA IS TRIGGERED WHICH ADDS THE NAMED COLLECTION IN AWS REKOGNITION VIA BOTO LIBRARIES. A SUCCESS/ERROR MESSAGE IS PUT IN THE RESPONSE PROCESSOR TOPIC. 6.WHEN A MESSAGE ARRIVES IN ADD FACE TOPIC, A LAMBDA IS TRIGGERED WHICH IDENTIFIES THE MOST PROMINENT FACE IN THE IMAGE AND ADDS THE METADATA FOR THE FACE TO THE GIVEN COLLECTION. IF THERE IS NO FACES IDENTIFIED, IT CREATES AN ERROR MESSAGE AND SENDS THE RESPONSE TO THE RESPONSE PROCESSOR TOPIC. 7. WHEN A MESSAGE ARRIVES IN MATCH FACE TOPIC, A LAMBDA IS TRIGGERED WHICH IDENTIFIES THE MOST PROMINENT FACE IN THE IMAGE AND MATCHES THE METADATA FOR THAT FACE WITH KNOWN FACES IN THE COLLECTION. IF A MATCH IS FOUND, THE CORRESPONDING PERSON’S NAME IS RETURNED. THE LAMBDA THEN USES IMDB TO LOOKUP THE BIOGRAPHY OF THE PERSON. 8. THE VARIOUS LAMBDA-BASED PROCESSORS DROPS THE RESPONSE MESSAGE ON THE RESPONSE PROCESSOR TOPIC. 9. THE RESPONSE PROCESSOR PICKS UP THE RESPONSE AND CONSTRUCTS A SMS MESSAGE AND CALLS TWILIO’S SMS SERVICE. 10.TWILIO VALIDATES THE FROM NUMBER AND SENDS THE MESSAGE TO THE CORRESPONDING TO NUMBER.
  • 35. 35 The CelebritySleuth application can be cloned from: https://github.com/skarlekar/faces The two main services are: Twilio Communication Service - https://github.com/skarlekar/faces/tree/master/twilioCommunicationService Face Recognition Service – https://github.com/skarlekar/faces/tree/master/faceRecognitionService
  • 36. 36 Security – Wrap a security blanket around twilioCommunicationService such that only authorized users are allowed to call the service. More information at: https://www.twilio.com/docs/api/security#http-authentication Validation – In addition to the security blanket above, validate that the twilioCommunicationService is called only from Twilio. More information at: https://www.twilio.com/docs/api/security#validating-requests VPC – As the faceRecognitionService is an internal service, secure it within a VPC. More information at: https://serverless.com/framework/docs/providers/aws/guide/functions#vpc- configuration

Notas del editor

  1. The technique of building applications using Serverless architecture is known as FaaS (Function as a Service). The reason becomes clear when you contrast FaaS applications with the traditionally built applications or PaaS (Platform as a Service) where there is a perpetual process running on a server waiting for HTTP requests or API calls. In FaaS there is no perpetual process (for the most part) but an event mechanism that triggers the execution of a piece of code, usually just a function. You still need a perpetual gateway that will field your API calls to start the events to cascade. The other key operational difference between FaaS and PaaS is scaling. With most PaaS solutions you still need to worry about scale. With FaaS the compute resources are provisioned at a request level. You cannot get the same level of granularity with PaaS applications even if you set it to auto-scale. As a result of this, FaaS applications are extremely efficient when it comes to managing cost.