Decoupling and Messaging Flashcards
1
Q
Loose Coupling
A
- almost always better
- you never want one EC2 instance talking to another instance -> you want some kind of managed service acting as the go between
2
Q
SQS
A
Simple queue service
- fully managed
- poll-based messaging
3
Q
Simple Notification Service
A
- to deliver notifications to an endpoint
- to deliver text messages or emails
4
Q
API Gateway
A
- a fully managed service that makes it easy for developers to create, publish, maintain, monitor and secure APIs at any scale
5
Q
SQS Producer
A
- writes the message to the queue
6
Q
SQS Consumer
A
- pickups up the message when they are ready
7
Q
SQS Setting - Delivery Delay
A
- default: 0
- up to 15 min
- queue holds the message
8
Q
SQS Setting - Message Size
A
- up to 256 KB of text in any format
9
Q
SQS & SNS Setting - Encryption
A
- default: messages are encrypted in transit
- optional: can add encryption at rest
10
Q
SQS Setting - Message Retention*
A
- default: 4 days
- minimum: 1 minute
- maximum: 14 days
11
Q
SQS Setting - Long Polling*
A
API connects and waits (not selected by default)
- always choose long polling on the exam
12
Q
SQS Setting - Short Polling*
A
API connects and gets a message and disconnects
- lots of overhead
- costly
- don’t choose on exam
13
Q
SQS Setting - Queue Depth*
A
- this can be a trigger for autoscaling as the messages back up
- Cloud Watch tells EC2 instance to spin up to address the queue
14
Q
SQS Visibility Timeout*
A
- default timeout: 30 seconds
- once the consuming service attempts to download a message from the queue, it is locked for X seconds so no one else can see it
- If the backend fails to process the message and tell the queue it’s good, the message will re-appear in the queue
Otherwise, if the backend sends back and all good message, then it is deleted from the queue
15
Q
Dead Letter Queues
A
- when a backend processes a message but the processing fails, it goes into the queue and gets stuck in a loop, instead, send it to a dead letter queue if they’ve reached the maximum # of re-tries
- same limits as regular SQS queue - max: 14 days