Skip to content

Commit 9570f3f

Browse files
committed
add serverless architecture lesson
1 parent 0b486c6 commit 9570f3f

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
98.6 KB
Loading
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Serverless Architecture
2+
3+
A serverless architecture is a way to build and run applications and services without having to manage infrastructure. Your application still runs on servers, but all the server management is done by the paltform you are using (For example, AWS). You no longer have to provision, scale, and maintain servers to run your applications, databases, and storage systems.
4+
5+
## Why use serverless architectures?
6+
7+
Hosting a software application on the internet usually involves managing some kind of server infrastructure. Typically this means a virtual or physical server that needs to be managed, as well as the operating system and other web server hosting processes required for your application to run. Using a virtual server from a cloud provider such as Amazon or Microsoft does mean the elimination of the physical hardware concerns, but still requires some level of management of the operating system and the web server software processes.
8+
9+
With a serverless architecture, you focus purely on the individual functions in your application code. Services such as AWS Lambda and Microsoft Azure Functions take care of all the physical hardware, virtual machine operating system, and web server software management. You only need to worry about your code.
10+
11+
## Advantages of serverless architecture
12+
13+
serverless architecture offers the following value propositions:
14+
15+
- Deploy & run. The infrastructure resources are managed by the cloud vendor. Internal IT can therefore focus on the business use case of software applications instead of managing the underlying hardware. Functions allow users to deploy application builds and configuration files necessary to provision the required hardware resources.
16+
- Fault tolerant. Since serverless application coding is logically decoupled from the underlying infrastructure, hardware failures have minimal impact on the software development process. Users are not required to manage applications on their own.
17+
- Low operational overhead. The infrastructure and operations management tasks are managed by cloud vendors, allowing organizations to focus their efforts on building software features. Applications are released faster, resulting in faster end-user feedback and therefore, continued improvements over the next software release cycles.
18+
- Optimized usage-based billing. The pay-as-you-go billing model serves particularly well for small and midsize (SMB) organizations that lack the capital to establish and manage on-site data centers.
19+
- Built-in integrations. Most cloud vendors offer integrations with a variety of services that allow users to focus on building high quality applications instead of configuring them.
20+
21+
## Types of serverless architecture software
22+
23+
There are three primary services offered via software developed with serverless architecture:
24+
25+
### Function as a service
26+
27+
In the realm of pre-packaged services, function as a service, sometimes known as FaaS or framework as, falls in between software as a service and platform as a service.
28+
29+
Think of FaaS as a ready-to-implement framework that can be easily tailored to the needs of an enterprise company. To be clear:
30+
31+
- SaaS is ready to use out of the box while FaaS is not.
32+
- However, FaaS does not require the resources to implement that you would need if you were using PaaS.
33+
34+
### Backend as a service
35+
36+
Similar to FaaS, backend as a service (BaaS) is another serverless technology. Some will contend that BaaS takes it a step further as a NoOps offering. NoOps essentially refers to infrastructure that has been automated to the point that in-house developers have no hand in its operation.
37+
38+
Here’s an easy way to look at BaaS: Imagine your enterprise organization is developing a mobile app to connect employees to important information on the go. You might develop the basic application framework in-house and then outsource the functionality. This includes backend processes like:
39+
40+
- Accessing cloud storage
41+
- Syncing
42+
- Social collaboration
43+
44+
### Database
45+
46+
Database serverless frameworks access and automate your database functions. These are functions that write and read from a database and can also provide a response.
47+
48+
## Use case of Serverless Architecture on AWS
49+
50+
Amazon Web Services. is a subsidiary of Amazon providing on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis.
51+
52+
In this use case, we are going to look at a simple to-do list web application that enables a registered user to create, update, view, and delete items.
53+
For this use case, we may use few AWS servless services:
54+
55+
- [AWS Lambda](https://aws.amazon.com/lambda/?c=ser&sec=uc1): is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers.
56+
- [Amazon API Gateway](https://aws.amazon.com/api-gateway/?c=ser&sec=uc1): is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. APIs act as the "front door" for applications to access data, business logic, or functionality from your backend services.
57+
- [Amazon DynamoDB](https://aws.amazon.com/dynamodb/?c=ser&sec=uc1): Fast, flexible NoSQL database service for single-digit millisecond performance at any scale.
58+
- [AWS Amplify](https://aws.amazon.com/amplify/hosting/): Faster, easier static web hosting with continuous deployment using the AWS Amplify Console.
59+
60+
A web application like the to-do list may use AWS Lambda and Amazon API Gateway for its business logic and Amazon DynamoDB as its database, and AWS Amplify Console to host all static content.
61+
62+
## Architectural Diagram
63+
64+
![Architectural Diagram](../assets/to-do-list-app-architecture.png)
65+
66+
This architecural diagram has the following tiers:
67+
Presentation: The static website content hosted in Amazon S3.
68+
Logic: The backend application is where the actual business logic is implemented. The code is implemented using Lambda functions fronted by an API Gateway REST API.
69+
Data: Amazon DynamoDB is used for storing the todo list items data.
70+
71+
For more info about this use case, visit the use cases on AWS [here](https://aws.amazon.com/serverless/), or see the github repository for the whole project [here](https://github.com/aws-samples/lambda-refarch-webapp).
72+
73+
---
74+
75+
## References
76+
77+
- https://d0.awsstatic.com/whitepapers/AWS_Serverless_Multi-Tier_Architectures.pdf
78+
- https://aws.amazon.com/lambda/serverless-architectures-learn-more/
79+
- https://aws.amazon.com/serverless/
80+
- https://www.twilio.com/docs/glossary/what-is-serverless-architecture

0 commit comments

Comments
 (0)