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 |