Modern Apps -- 04 -- AWS Serverless

AWS Serverless

Get Started. It's Free
or sign up with your email address
Modern Apps -- 04 -- AWS Serverless by Mind Map: Modern Apps -- 04 -- AWS Serverless

1. Compute

1.1. AWS Lambda

1.1.1. **AWS Lambda** is an event-driven, pay-as-you-go compute service that lets you run code without provisioning or managing servers. Usecase File Processing Stream Processing Web Application Iot Backends Mobile Backends

1.2. AWS Fargate

1.2.1. **AWS Fargate** is a serverless compute engine that works with Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS).

2. Application Integration

2.1. Amazon EventBridge

2.1.1. **Amazon EventBridge** is a serverless event bus that lets you build event-driven applications at scale across AWS and existing systems.

2.2. AWS Step Functions

2.2.1. **AWS Step Functions** is a visual workflow orchestrator that makes it easy to sequence multiple AWS services into business-critical applications.

2.3. Amazon SQS

2.3.1. **Amazon Simple Queue Service (SQS)** is a message queuing service enabling you to decouple and scale microservices, distributed systems, and serverless applications.

2.4. Amazon SNS

2.4.1. **Amazon Simple Notification Service (SNS)** is a fully managed messaging service for both application-to-application (A2A) and application-to-person (A2P) communication.

2.5. Amazon API Gateway

2.5.1. **Amazon API Gateway** is a fully managed service that makes it easy to create and publish APIs at any scale.

2.6. AWS AppSync

2.6.1. **AWS AppSync** is a fully managed service that accelerates application development with scalable GraphQL APIs.

3. Datastore

3.1. Amazon S3

3.1.1. **Amazon Simple Storage Service (Amazon S3)** is an object storage service designed to store and protect any amount of data.

3.2. Amazon DynamoDB

3.2.1. **Amazon DynamoDB** is a key-value and document database service, delivering single-digit millisecond performance at any scale.

3.3. Amazon RDS Proxy

3.3.1. **Amazon RDS Proxy** is a managed database proxy for Amazon Relational Database Service (RDS) that makes applications more scalable and secure.

3.4. Amazon Aurora Serverless

3.4.1. **Amazon Aurora Serverless** is a MySQL and PostgreSQL-compatible relational database that automatically scales capacity based on your application's needs.

4. What's Serverless ?

4.1. **Serverless** computing is a method of providing backend services on an as-used basis. A serverless provider allows users to write and deploy code without the hassle of worrying about the underlying infrastructure.

4.2. Serverless computing allows you to build and run applications and services without thinking about servers. Serverless applications don’t require you to provision, scale, and manage any servers. You can build them for nearly any type of application or backend service, and everything required to run and scale your application with high availability is handled for you.

4.3. Building serverless applications means that you can focus on your core product instead of worrying about managing and operating servers or runtimes. You are only responsible for providing the serverless function and are not aware of the underlying compute resources.

4.4. The serverless runtime provisions server resources automatically, and customers are billed according to the number of times and the duration their function actually ran. Serverless is a model of computing that runs code on-demand without the need to provision or manage infrastructure. Development teams simply deploy their code on a serverless platform and are only charged when that code runs and consumes server resources.

5. Identify ? (eg: Lambda)

5.1. Environment

5.1.1. Underlying infrastructure managed by Cloud Provider. You cannot choose infrastructure own your own

5.1.2. No Patching headache

5.1.3. Can’t install software (e.g. WebServer, AppServer, Custom Software) in underlying environment

5.1.4. Code libraries can be installed. (e.g. npm, NuGet packages)

5.2. Resource Configuration

5.2.1. Allocate memory and CPU proportionally

5.2.2. Choose memory from 128 MB to 10 GB

5.2.3. CPU cores are allocated proportionally between 1 to 6 cores

5.2.4. Limited deployment package size: 250 MB - unzipped, 50 MB - zipped

5.2.5. No attached hard disk

5.3. Scaling

5.3.1. No scaling configuration is required. Scales automatically

5.3.2. Usually, each request connection invokes a new Lambda instance

5.3.3. Control using concurrency limit

5.4. Cost

5.4.1. With serverless computing, you only pay for what you use (Pay-as-you-use)

5.4.2. For highly burstable workloads, serverless can lead to significant cost savings. For workloads with consistent demand, serverless may not make much difference (or sometime it is more costlier)

5.5. Run Duration

5.5.1. Serverless functions typically run for a short period of time (minutes or seconds) and are shut down as soon as they finish processing the current event

5.5.2. Maximum runtime: 15 minutes (900 seconds)

5.6. Integration with Other Services

5.6.1. (AWS Lambda) Natively integrated with S3, SNS, SQS, and many other AWS services

5.7. High Availability

5.7.1. Lambda is inherently highly available, out of the box. (Each Lambda deployed on Multi-AZ automatically)

5.7.2. No need for a Load Balancer

5.8. Logging & Monitoring

5.8.1. Integrated with CloudWatch for monitoring

5.8.2. Logs go to CloudWatch out of the box

5.8.3. Logs can be sent to other logging systems using Lambda Extensions

5.9. Portability/Vendor lock-in

5.9.1. With serverless, You are highly dependent on the platform that runs your code

5.10. Supported languages

5.10.1. To run an application in a serverless model, the serverless runtime must explicitly support that language (different platforms support different languages)

5.11. Development and Testability

5.11.1. Serverless is more difficult to run outside a cloud environment. You are limited to the cloud platform running functions

5.12. Security

5.12.1. Control what service/api can invoke Lambda using resource policy

5.12.2. Control what service can Lambda invoke using IAM Role

5.12.3. Same security group:subnet combo reuse same ENI (IP)

5.12.4. FedRAMP (high) compliance

5.13. Operational Complexity

5.13.1. Serverless architecture has no backend to manage. There is effectively no infrastructure to manage