Created by: Nguyen.dovan
1. Serverless?
2. Introduction infra AWS – App Serverless
3. What is AWS Lambda?
4. Demo on aws console
5. Demo from serverless yml
6. Q&A
 Serverless architecture, also known as
function as a service (FaaS), is lately one of
the hottest trends in cloud computing.
 Timeline:
 When deylod to production poses several challenges:
◦ What is right configuration (RAM/CPU/Disk) for my
workload?
◦ What is the right budget?
◦ When is the time to scale out my workload?
◦ Are we utilising our server capacity?
◦ What is the right OS to run on?
◦ Is my OS patched correctly?
◦ How to handle server upgrades?
◦ Application upgrades?
 Compare Client-server và serverless
 Advantage is that serverless
◦ Pricing
◦ Event-driven
◦ Auto-scaling
◦ Environments: You no longer need to set up dev, staging, and
production machines
◦ Simple code & deploy
 The downside is that serverless
◦ Performance
◦ debug
◦ The downside is that Serverless functions are accessed only
as private APIs
Compare Client-server vs Serverless
 Serverless Frameworks Includes:
◦ Node Lambda (Javascript)
◦ Serverless (Javascript, Python, Golang)
◦ ClaudiaJS (Javascript)
◦ Gordon (Javascript)
◦ Zappa (Python)
◦ Up (Javascript, Python, Golang, Crystal)
◦ …
 You could consider running your:
◦ Server backends
◦ Mobile backends
◦ Data processing modules
◦ Log processing modules
◦ Continous integration modules
◦ IoT(Weather stations)
◦ Chatbots
Compare Serverless
 Amazon Route 53 is a highly available and
scalable Domain Name System (DNS) web service.
◦ DNS Management
◦ Traffic management
◦ Availability monitoring
◦ Domain registration
 Advantage
◦ Đơn giản
◦ Nhanh
◦ Giá rẻ: $0.51/tháng
◦ Đảm bảo
◦ Linh hoạt
 Create, maintain, and secure APIs at any scale
 Features
◦ Build, deploy, and manage APIs
◦ Resiliency(khả năng phục hồi)
◦ API Lifecycle Management
◦ SDK Generation
◦ API Operations Monitoring
◦ AWS Authorization
◦ API Keys for Third-Party Developers
 Pricing
◦ Free Tier: 1M API CALLS RECEIVED / MONTH
◦ API Calls: $4.25 per million API calls received
 Simple and Secure User Sign-Up, Sign-In, and
Access Control
 Amazon Cognito User Pools is a standards-
based Identity Provider: Oauth2.0, Facebook,
google, OpenID..
 Pricing
◦ Pricing Tier : free first 50.000 MAUs/ month
◦ $0.00550 -> next 50.000 MAUs
 Highly programmable, secure content delivery
network (CDN)
 Object storage built to store and retrieve any
amount of data from anywhere
 Amazon S3 stores data as objects within
resources called "buckets".
 Pricing
◦ Free tier: 5 GB of Amazon S3 storage, 20,000 Get
Requests, 2,000 Put Requests, and 15 GB of data
transfer out each month for one year
 AWS DynamoDB provides a fully managed
NoSQL database
 Fast and flexible nonrelational database
service for any scale
 Pay only for the throughput and storage you
need
 Pricing
◦ Free tier: 200 million requests per month, 25 GB of
indexed data storage.
“Run code without provisioning or mananing
servers”
 Pricing
◦ Only charged when running code
◦ No usage = No costs
◦ Genrious free tiers:
 1M request/ 1 month
 3M compute seconds
 Scalability:
◦ Upload your code & be done!
◦ Amazon handles scaling (up & down)
 Scalability
 Scalability
◦ Functions
◦ Events
◦ Resources
◦ Services
◦ Plugins
 Functions:
◦ Unit of deployment
◦ Package of code
◦ Responsible single task
◦ Support for:
 Node.js
 Python
 Java
 C#
 Events
◦ Triggers functions
◦ Infrastructure provisioned automatically
 Resources
◦ Define used AWS services
◦ Serverless will provision theme
◦ Automated process
◦ Repeatable: other AWS account
 Services
◦ Unit of organization
◦ Contains config for all functions, events and
resources
 Plugin
◦ Extend the framework
◦ Examples:
 Support TypeScript
 Optimize JS code
 …
 AWS account
 Node.js
 AWS CLI and configure it
 Custom serverless.yml file
Overview serverless architecture
Overview serverless architecture

Overview serverless architecture

  • 1.
  • 2.
    1. Serverless? 2. Introductioninfra AWS – App Serverless 3. What is AWS Lambda? 4. Demo on aws console 5. Demo from serverless yml 6. Q&A
  • 4.
     Serverless architecture,also known as function as a service (FaaS), is lately one of the hottest trends in cloud computing.
  • 5.
  • 6.
     When deylodto production poses several challenges: ◦ What is right configuration (RAM/CPU/Disk) for my workload? ◦ What is the right budget? ◦ When is the time to scale out my workload? ◦ Are we utilising our server capacity? ◦ What is the right OS to run on? ◦ Is my OS patched correctly? ◦ How to handle server upgrades? ◦ Application upgrades?
  • 7.
     Compare Client-servervà serverless  Advantage is that serverless ◦ Pricing ◦ Event-driven ◦ Auto-scaling ◦ Environments: You no longer need to set up dev, staging, and production machines ◦ Simple code & deploy  The downside is that serverless ◦ Performance ◦ debug ◦ The downside is that Serverless functions are accessed only as private APIs
  • 8.
  • 10.
     Serverless FrameworksIncludes: ◦ Node Lambda (Javascript) ◦ Serverless (Javascript, Python, Golang) ◦ ClaudiaJS (Javascript) ◦ Gordon (Javascript) ◦ Zappa (Python) ◦ Up (Javascript, Python, Golang, Crystal) ◦ …
  • 11.
     You couldconsider running your: ◦ Server backends ◦ Mobile backends ◦ Data processing modules ◦ Log processing modules ◦ Continous integration modules ◦ IoT(Weather stations) ◦ Chatbots
  • 13.
  • 15.
     Amazon Route53 is a highly available and scalable Domain Name System (DNS) web service. ◦ DNS Management ◦ Traffic management ◦ Availability monitoring ◦ Domain registration  Advantage ◦ Đơn giản ◦ Nhanh ◦ Giá rẻ: $0.51/tháng ◦ Đảm bảo ◦ Linh hoạt
  • 16.
     Create, maintain,and secure APIs at any scale  Features ◦ Build, deploy, and manage APIs ◦ Resiliency(khả năng phục hồi) ◦ API Lifecycle Management ◦ SDK Generation ◦ API Operations Monitoring ◦ AWS Authorization ◦ API Keys for Third-Party Developers  Pricing ◦ Free Tier: 1M API CALLS RECEIVED / MONTH ◦ API Calls: $4.25 per million API calls received
  • 17.
     Simple andSecure User Sign-Up, Sign-In, and Access Control  Amazon Cognito User Pools is a standards- based Identity Provider: Oauth2.0, Facebook, google, OpenID..  Pricing ◦ Pricing Tier : free first 50.000 MAUs/ month ◦ $0.00550 -> next 50.000 MAUs
  • 18.
     Highly programmable,secure content delivery network (CDN)
  • 19.
     Object storagebuilt to store and retrieve any amount of data from anywhere  Amazon S3 stores data as objects within resources called "buckets".  Pricing ◦ Free tier: 5 GB of Amazon S3 storage, 20,000 Get Requests, 2,000 Put Requests, and 15 GB of data transfer out each month for one year
  • 20.
     AWS DynamoDBprovides a fully managed NoSQL database  Fast and flexible nonrelational database service for any scale  Pay only for the throughput and storage you need  Pricing ◦ Free tier: 200 million requests per month, 25 GB of indexed data storage.
  • 22.
    “Run code withoutprovisioning or mananing servers”  Pricing ◦ Only charged when running code ◦ No usage = No costs ◦ Genrious free tiers:  1M request/ 1 month  3M compute seconds  Scalability: ◦ Upload your code & be done! ◦ Amazon handles scaling (up & down)
  • 23.
  • 24.
  • 25.
    ◦ Functions ◦ Events ◦Resources ◦ Services ◦ Plugins
  • 26.
     Functions: ◦ Unitof deployment ◦ Package of code ◦ Responsible single task ◦ Support for:  Node.js  Python  Java  C#
  • 27.
     Events ◦ Triggersfunctions ◦ Infrastructure provisioned automatically  Resources ◦ Define used AWS services ◦ Serverless will provision theme ◦ Automated process ◦ Repeatable: other AWS account  Services ◦ Unit of organization ◦ Contains config for all functions, events and resources
  • 28.
     Plugin ◦ Extendthe framework ◦ Examples:  Support TypeScript  Optimize JS code  …
  • 29.
     AWS account Node.js  AWS CLI and configure it
  • 30.

Editor's Notes

  • #5 Một số ứng dụng chuyển phần lớn logic về front-end, không có server để làm back-end (serverless)  mà chỉ sử dụng các API của bên thứ 3(Firebase, Cloudinary) để thay thế - gọi là Backend as a Service – BaaS Trường hợp khác, dev tự viết code làm back-end. Với mô hình client-server thông thường, ta phải thuê server rồi deploy ứng dụng lên server. Với mô hình serverless, thay vì deploy code này lên server, ta deploy nó dưới dạng một Function (Function as a Service – FaaS). Funtion này có thể được gọi dưới dạng RestAPI hoặc chạy theo lịch đã sắp sẵn. Với FaaS, ta chỉ cần viết code mà không cần quan tâm đến việc server và code sẽ nằm ở đâu. Bên thứ 3(Amazon, Microsoft, google) Infrastructure as a Service (IaaS) : It provides only a base infrastructure (Virtual machine, Software Define Network, Storage attached). End user have to configure and manage platform and environment, deploy applications on it. Ex: AWS (EC2), GCP (CE), Microsoft Azure (VM) Platform as a Service (PaaS): It provides a platform allowing end user to develop, run, and manage applications without the complexity of building and maintaining the infrastructure. Google App Engine, CloudFoundry, Heroku, AWS (Beanstalk) are some examples of PaaS. Function as a Service (FaaS): It provides a platform allowing customers to develop, run, and manage application functionalities without the complexity of building and maintaining the infrastructure
  • #7 Với ông DevOps thì những issue trên ko sao..
  • #8 Event-driven: biến chi phí hang tháng thành chi phí cho từng hành động
  • #11 Chúng ta chỉ tập trung vào Serverless framework: https://serverless.com
  • #12 Usecase: Web application: màn hình dashboard, dữ liệu report, thống kê lấy từ nhiều nguồn khác nhau Data processing: như thao tác với ảnh: up ảnh có độ phân giải cao -> chức năng resize thành nhiều kích thước khác nhau. Các ứng dụng chat
  • #15 Sơ đồ infra của 1 dự án triển khai theo mô hình Serverless
  • #16 Amazon Route 53 là dịch vụ giúp bạn có thể quản lý, tạo, chỉnh sửa, xóa,.. các DNS tên miền của bạn kết hợp với các dịch khác. Nói nôm na nó gần giống như các nhà cung cấp các dịch vụ tên miền như Godaddy, Name, tenten, PA,.. bạn có thể mua tên miền sau đó bạn sẽ thao tác các như tạo các bản ghi: A, CNAME, TXT,.. Bạn có thể tự tạo NAMESERVER cho riêng hệ thống bạn.
  • #18 Invoke: gọi Chứng thực user IAM IAM roles are a secure way to grant permissions to entities(Lambda, deploy, commitcode…) that you trust. Examples of entities include the following https://console.aws.amazon.com/iam
  • #19 MAUs: monthly active users
  • #20 Amazon CloudFront là dịch vụ mạng nội dung toàn cầu (CDN) cung cấp dữ liệu, video, ứng dụng và API cho người xem một cách an toàn với độ trễ thấp và tốc độ truyền cao. CloudFront được tích hợp với AWS – cả các vị trí vật lý được kết nối trực tiếp với cơ sở hạ tầng toàn cầu của AWS, cũng như phần mềm hoạt động liên tục với các dịch vụ bao gồm AWS Shield ngăn chặn DDoS, Amazon S3, Elastic Load Balancing hoặc Amazon EC2làm source cho các ứng dụng của bạn, và AWS Lambda để chạy mã tùy chỉnh gần với người xem của bạn Hiệu năng cao Chi phí hiệu quả Dễ sử dụng