Serverless Architecture on AWS

17
Serverless Architecture on AWS Prepared by Rajind Ruparathna

Transcript of Serverless Architecture on AWS

Page 1: Serverless Architecture on AWS

Serverless Architecture on AWS

Prepared by Rajind Ruparathna

Page 2: Serverless Architecture on AWS

Outline

● What is AWS?● Most Popular AWS Products● What is Serverless Architecture?● Asynchronous Serverless Model ● Synchronous Serverless Model● Amazon Lambda

Page 3: Serverless Architecture on AWS

What is AWS?

“Amazon Web Services (AWS) is a secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses scale and grow. Explore how millions of customers are currently leveraging AWS cloud products and solutions to build sophisticated applications with increased flexibility, scalability and reliability.” - Amazon(https://aws.amazon.com/what-is-aws/)

Page 4: Serverless Architecture on AWS

Most Popular AWS Productshttp://2ndwatch.com/blog/the-most-popular-aws-products-of-2016/

Source - http://2ndwatch.com/blog/the-most-popular-aws-products-of-2016/

Page 5: Serverless Architecture on AWS

What is Serverless Architecture?Serverless Architecture is also called Function as a Service (FaaS).

A serverless architecture allows you to run your application—including computing, storing, and networking-—without the need for spinning up and managing a single (virtual) machine.

Page 6: Serverless Architecture on AWS

What is Serverless Architecture? contd.

Source - https://dzone.com/articles/serverless-faas-with-aws-lambda-and-java?

Page 7: Serverless Architecture on AWS

Asynchronous Serverless Model

In an asynchronous scenario, the caller does not wait until the function returns. Notifications via WebSocket or push notifications to a mobile device can be used to provide feedback to the user.

Page 8: Serverless Architecture on AWS

Asynchronous Serverless Model contd.

Page 9: Serverless Architecture on AWS

Synchronous Serverless Model

A typical use case for the synchronous model is a REST API. An incoming HTTPS request is triggering a serverless function. The caller waits until the function returns a result.

Page 10: Serverless Architecture on AWS

Synchronous Serverless Model contd.

Page 11: Serverless Architecture on AWS

Amazon Lambda

Computer service to run users back-end code in response to events such as an update to Dynamo DB, uploads to amazon S3 bucket, data in Amazon Kinesis streams or In-app activity.

AWS provides the computing infrastructure and a runtime environment for JavaScript (Node.js), Java, Python, or .NET Core (C#).

● No Servers to Manage● Continuous Scaling● Sub Second Metering

Page 12: Serverless Architecture on AWS

Using Amazon Lambda

Page 13: Serverless Architecture on AWS

Using Amazon Lambda contd.

Page 14: Serverless Architecture on AWS

Using Amazon Lambda contd.

Page 15: Serverless Architecture on AWS

Limitations of AWS Lambda

● On AWS Lambda, there is an execution time out of 5 minutes for every function execution.

Nevertheless, you can execute the same or different functions in a highly parallel manner. Dividing your application into small functions is necessary when following a serverless approach.

Page 16: Serverless Architecture on AWS

Limitations of AWS Lambda

● A serverless function is stateless. Persisting state between two executions of the same function is not possible in general. Neither in memory nor on disk.

Therefore your serverless function needs to store state externally. On AWS there are the following options to store data: Amazon DynamoDB, a NoSQL database, and Amazon S3, an object store.