11. Serverless II

2023. 12. 5. 17:49· CS/클라우드컴퓨팅
목차
  1. Other Serverless AWS Services
  2. AWS SQS
  3. AWS SNS
  4. Serverless Characteristics of S3
  5. Lambda@Edge
  6. API Gateway
  7. AWS Step Functions

Other Serverless AWS Services

AWS SQS

AWS SQS(Simple Queue Service)

  • fully-maanged message queueing service that stores messages
  • messages are stored(but will expire) until they are processed and deleted
  • act as a buffer btw senders and receivers
  • securely share SQS queues anonymously or with specific accounts
    • queue sharing can also be restricted by IP address and time of day
  • msgs are stored in encrypted form, and SQS decrypts msg only when they are sent to an authorized consumer

Benefits of Amazon SQS

  • requires no administrative overhead and little configuration for message queueing
  • decouple processing steps from compute steps and postprocessing steps
    • using asynchronouse processing -> separate producer logic & consumer logic
  • makes the system more resilient with high volume capacities
    • acts as a buffer to absorb spikes in traffic
    • gives your application additional time to complete scale-out actions
  • built-in fault tolerance
    • if exception or transaction failure -> order processing can be retried
    • after the maximum number of retries, SQS can redirect the msg to SQS dead-letter queue where you can reprocess or debug it later

Achieving Loose Coupling with SQS

  • Use asynchronous processing to get responses from each step quickly
  • Handle performace and requirements by increasing the number of job instances (worker instances)
  • Messages will remain in the queue

Amazon SQS Queue Types

  • Standard Queue
    • at-least-once delivery: occasionally more than one copy of a msg is delivered
    • best-effort ordering: occasionally msgs might be delivered in out-of-order
    • nearly ultimated number of tx per second (TPS) per API action
  • FIFO Queue
    • guarantee that msgs are processed exactly once, in the exact order that they are sent
    • support up to 300 msgs per second
    • 순서가 중요하고 중복이 허용되지 않는 상황에서 사용

Use Cases

  • Work queues
    • decouple components of a distributed aplplications
  • Buffering and batch operations
    • add scalability and reliability to your architecture
    • smooth out temporary volume spikes without losing msgs or increasing latency
  • Request offloading
    • enqueue slower erquests
  • Auto scaling
    • determine the load on an application
    • can combined with auto scaling

 

AWS SNS

AWS SNS (Simple Notification Service)

  • web service that makes it easy to set up, operate, and send notifications from the cloud
  • follows the publish-subscribe messaging paradigm, with notifications beling delivered using a push mechanism
  • create a topic and control access to it by defining policies that determine which publishers and subscribers can communicate with the topic
    • each topic has a unique name that identifies that SNS endpoint
    • subscribers receive all msgs published to the topics to which they subscribe

Amazon SNS Subscription Types

  • Email
    • Email-JSON sends notifications as JSON object, while email sends text-based email
  • Mobile text messaging (SMS)
    • sent to phone numbers as SMS text msg
  • HTTP/HTTPS
    • notifications are delivered through an HTTPS POST to the subscriber's specified URL
  • Amazon SQS
    • enqueue a notification msg to specified SQS standard queue
  • AWS Lambda
    • msgs can be delivered to AWS Lambda functions

Amazon SNS Characteristics

  • A single published msg
    • notification msg contain a single published msg
  • No recall options available
    • when msg delivered successfully, no way to recall it
  • Retries take place with HTTP or HTTPS
    • SNS delivery policy can control the retry pattern
    • provide access control mechanism to ensure topic and msgs are secured against unauthorized access
  • Order and delivery isn't guaranteed
    • to prevent msgs from being lost, all msgs published to SNS are stored redundantly across multiple servers and data centers

Use Cases

  • receive an immediate notification when an event occurs
  • push targeted news headlines to subscribers
  • notifications to app indicating that an update is available

Amazon SNS and SQS Difference -표 15p

Features Amazon SNS Amazon SQS
Message persistence No Yes
Delivery mechanism Push(passive) Pull(active)
Producer and consumer Publisher and subscriber Send or receive
Distribution mode one-to-many one-to-one

 

Serverless Characteristics of S3

Serverless Characteristics of S3

  • Pay for value : pay for what you use
  • Elastic storage: storage capacity grows and shrinks automatically
  • Continuous scaling: fully scalable
  • Fault tolerance: high data durability of objects, high availability
  • No server management

 

Lambda@Edge

Lambda@Edge

  • feature of Amazon CloudFront that lets you run code closer to the users of your application, which improve performance and reduces latency
    • you don't have to provision or manage infrastructure in multiple locations
  • pay only for the compute time that you consume
  • making your application globally distributed and improving their performance
  • zero server administration

 

API Gateway

API Gateway

  • With API Gateway, you can create, publish, maintain, monitor, and secure APIs
  • API Gateway allows you to create APIs that act as "front door" for your applications
    • can handle up to hundreds of thousands of concurrent API calls
    • prevent exposing endpoints
    • integrates with AWS Lambda
    • integrates with private VPCs
    • create and distribute API keys

 

AWS Step Functions

AWS Step Function

  • serverless function orchestrator that you can use to sequence AWS Lambda functions and multiple AWS services into business-critical applications
  • low-code, visual workflow service that used to build distributed applications, automate IT business process, machine learning pipelines
  • coordinate individual tasks into a visual workflow
  • developers can focus on logic
  • change and add steps without writing code

Benefits of AWS Step Function

  • Build and deploy rapidly
    • get started quickly with Workflow Studio, a drag-and-drop interface
    • express complex business logic as low-code, event-driven workflows
  • Write less integration code
    • Step Functions can integrate with many other AWS services
  • Build fault-tolerant and stateful workflow
    • managing state, checkpoint, restart
  • Designed for reliability and scale
    • standard workflow: manage long-running workloads
    • express workflows: support high-volume event processing workload

Features and Functionality of Step Function

  • define and manage the workflow independently from its business logic
  • AWS service integrations
  • can coordinate any apps that can make an HTTPS connection
  • workflow abstraction
  • built-in error handling
  • history of each job
  • visual monitoring
  • compliance Health Insurance Portability and Accountability ACT (HIPAA) eligible

Step Functions States

  • State: elements in your state machine
    • referred to by its name, must be unique within the scope of the entire state machine
  • individual states can make decisions based on their input, perform actions and pass output to other states
  • Step Function console providese a graphical representation of state machine

State Machine

  • State machine is an object that has a set number of operating conditions that depend on its previous condition to determine output
  • you can use Step Functions to create and automate your own state machines
  • Step Functions uses JSON-based Amazon States Language
  • 여러 단계 또는 상태를 가진 프로세스를 표현, 제어 하는 데 사용
저작자표시 (새창열림)

'CS > 클라우드컴퓨팅' 카테고리의 다른 글

14. Container  (0) 2023.12.07
12, 13. Virtualization  (0) 2023.12.07
10 Serverless I  (0) 2023.12.05
9. Security  (0) 2023.12.03
Lec 08: Cloud Operations  (0) 2023.12.02
  1. Other Serverless AWS Services
  2. AWS SQS
  3. AWS SNS
  4. Serverless Characteristics of S3
  5. Lambda@Edge
  6. API Gateway
  7. AWS Step Functions
'CS/클라우드컴퓨팅' 카테고리의 다른 글
  • 14. Container
  • 12, 13. Virtualization
  • 10 Serverless I
  • 9. Security
호프
호프
Untitled호프 님의 블로그입니다.
호프
Untitled
호프
전체
오늘
어제
  • 분류 전체보기 (341)
    • 오류😬 (4)
    • 스터디📖 (96)
      • 웹 개발 기초 (8)
      • Spring (20)
      • ML, DL (30)
      • Node.js (22)
      • React (0)
      • 블록체인 (12)
      • Go (3)
      • Javascript (1)
    • 알고리즘💻 (153)
      • 그리디 (23)
      • Bruteforce&Backtracking (16)
      • DP (17)
      • 이분탐색&정렬&분할정복 (17)
      • 누적합&투포인터 (6)
      • 스택&큐&덱 (19)
      • 그래프(DFS&BFS) (19)
      • 트리 (7)
      • 우선순위큐&다익스트라 (11)
      • 벨만포드&플로이드와샬 (8)
      • map&set&number theory (5)
      • 기타 (5)
    • 프로젝트 (3)
      • 캡스톤 디자인 프로젝트 (3)
    • 블록체인🔗 (3)
      • Solana (2)
      • 개발 (0)
      • Harmony (1)
    • ASC (6)
    • CS (73)
      • 데이터베이스 (12)
      • 클라우드컴퓨팅 (21)
      • 운영체제 (11)
      • 컴퓨터네트워크 (14)
      • 블록체인응용 (15)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 복습

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.1
호프
11. Serverless II
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.