# ⛅ Architecture Patterns for building Serverless Applications ⚡

🎯 Modernizing with Serverless-First Approach

🎯 Architecture Patterns for building Serverless-App.


## Benefits of Serverless Computing (Lambda) ⚡ 

* No infrastructure provisioning, no management
* Automatic scaling
* Pay-for-use
* Highly available and secure


## Pattern 1. Serverless Web Applications - Serverless Backend

> Use-case 1: Performance Dashboard Solution

![Figure 2: Serverless Backend](https://cdn.hashnode.com/res/hashnode/image/upload/v1665741888843/cH3bFybVq.png align="left")

* **Amazon API-Gateway**

  * A managed API platform that is compatible with OpenAPI
  * From edge to private APIs (Edge, regional, access to VPC and private APIs) + From API to any endpoint (inside or outside of AWS Cloud).
  * Monitored & traced via CloudWatch and X-Ray.
  * Super easy Lambda Integration.
  * A wide range of features - models, cache, and usage plans

![Figure 2. API Gateway - Serving Dynamic Content](https://cdn.hashnode.com/res/hashnode/image/upload/v1665741931389/QgmsLRz4l.png align="left")


## Pattern 2. Serverless Web Applications - GraphQL Serverless Backend

> Use-case 2: [SmartChat WhatsApp-like Real-Time & Offline Messaging Web-App](https://solution.job4u.io/Digital-Platform/WhatsApp-like-SmartChat/)

![Figure 3. GraphQL Serverless Backend](https://cdn.hashnode.com/res/hashnode/image/upload/v1665741993802/s7c1cQNZl.png align="left")

## Managing Costs for Serverless Workloads

* [x] [**Lambda Power Tuning**](https://github.com/alexcasalboni/aws-lambda-power-tuning): Utilize Lambda Power Tuning to decide how much memory to allocate to lambda functions to achieve the right performance and cost balance. 
* [x] **Compute Optimizer** is a passive approach that uses machine learning algorithms to analyze the function executions and recommend changes to enhance performance and reduce costs.  
* [ ] Lambda - Provisioned concurrency
* [ ] Lambda - Log tuning
* [ ] Lambda – AVX2

## [Performance Dashboard] Path to Modernization

* [x] Step 1. Strategy

  + [ ] Re-platform
  + [ ] Refactor
  + [x] Build New

* [x] Step 2. Pilot

  + [ ] Move to manage
  + [x] Build new with serverless

* [x] Step 3. Define

  + [x] Development practices
  + [x] Operational expertise
  + [x] Deployment best practices
  + [x] Cost management & governance

* [ ] Step 4. Optimize

  + [x] Decrease build & deployment time
  + [ ] Increase TCO
  + [ ] Increase time to market

* [ ] Step 5. Scale

  + [ ] Organization wide
  + [ ] Critical workloads
  + [x] Global reach

* ✍️ Accelerate your organization-wide adoption (Define | Optimize | Scale):

  + [ ] Enable Cloud Center of Excellence (CCOE) for Cloud Native apps
  + [ ] Establish a Shared Services Platform (SSP)
  + [ ] Build a community

## Building an End-to-End Serverless Web Application

### 1. Business Case: [TODO]

### 2. Frontend: React.js: [TODO]

### 3. Backend: Node.js [TODO]

### 4. IaC: CDK [TODO]

### 5. Open-Source [TODO]: https://github.com/OceanSoftIO/Serverless

