lambda serverless & serverless microservices · lambda functions api gateway typescript...

14
Date: Author: Lambda, Serverless & Serverless Microservices 9/3/2019 Than Dao

Upload: others

Post on 11-Jul-2020

81 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

Date:

Author:

Lambda, Serverless & Serverless Microservices

9/3/2019

Than Dao

Page 2: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Content

Lambda functions

API Gateway

Typescript

Serverless framework

Serverless Microservices

Some AWS services and Demo session

2

Page 3: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Lambda functions

Virtual functions

Based on Serverless architecture

Responsible only for your code

Limited by time execution (15mins)

Scale automatically

3

Page 4: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Lambda functions

Languages: NodeJS, Java, Python, C#, …

Stores code in Amazon S3

Integration: API gateway, S3, SQS,…

Can be triggered from AWS services

Pay on demand

4

Page 5: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Lambda functions

Pros Cons

- Run apps without managing server - 1000 concurrent executions

- Not running your app for 24/7 - Can not control environment

- Pay on demand - Limit function execution time: 15mins

- Auto scaling

- Trigger by multiple AWS services

5

Page 6: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

API Gateway

Sit in front of API, single entryway into a system

Takes all API call, routes to appropriate

Microservices, APIs

6

Page 7: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

API Gateway

Pros Cons

- Hide your system’s structure - Affect performance due to lots of request

- Client can get data by single hit - Can become single point of failure

- Logging, authentication - Increase the complexity of the system

- Can handle partial failure

7

Page 8: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Typescript

A superset of JavaScript

Created by Microsoft in 2010, release in 2012

Open source, written by Typescript itself

Using static typing, and is optional

Inheritance – OOP principles

8

Page 9: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Serverless Framework

Easy way to manage Lambda functions

Integrating well with CI/CD tools

Having stack’s Cloudformation supports

Support multiple language: NodeJS, Java,..

Commands: deploy, create,..

9

Page 10: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Microservices or Microservice Architecture

10

Page 11: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Serverless Microservices

11

Based on Microservice architecture

Using API Gateway

Only run when they are needed by applications

Can be FaaS

Page 12: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Serverless Microservices

Pros Cons

- Independently develop and deploy services - Testing can become complicated

- Different services can use different languages - Managing whole products can become complicated

- Easy integration and automatic deployment

- Update services separately

- Better fault isolation

12

Page 13: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential

Demo

13

Some AWS services: S3, Lambda, API Gateway, Cloudformation, Cloudwatch Logs

Example: Lambda functions, Serverless Framework, Typescript

Run on local by serverless offline

Deploy to AWS

Page 14: Lambda Serverless & Serverless Microservices · Lambda functions API Gateway Typescript Serverless framework Serverless Microservices Some AWS services and Demo session 2 / Confidential

/ Confidential 14

Thanks for listening!

Q&A?