Open JustJordanT opened 8 months ago
Push vs Poll:
Delivery Guarantee:
Processing Semantics:
Ordering and Deduplication:
Fan-Out Architecture:
Cost:
Complexity and Maintenance:
How an SNS message can triggers an HTTPS call to your Orders endpoint to create an order with a specific customer ID, you could follow these steps:
Create an SNS Topic:
Create an HTTPS Subscriber:
Publish Messages to SNS:
Process SNS Notifications:
Parse Customer ID and Create Order:
Handle Errors and Retries:
Here's a simplified illustration of what the SNS message and your Orders endpoint might look like:
SNS Message:
{
"Type" : "Notification",
"MessageId" : "unique-id",
"TopicArn" : "arn:aws:sns:region:account-id:your-topic",
"Message" : "{\"customer_id\": 12345}",
...
}
Orders Endpoint:
POST /create-order HTTP/1.1
Host: your-orders-endpoint.com
Content-Type: application/json
{
"customer_id": 12345
}
This setup allows you to send a customer ID to SNS and have it trigger an HTTPS call to your Orders endpoint to create an order with that ID. The decoupling provided by SNS allows for more scalable and maintainable architecture, as your order creation logic is isolated from the publishing service.
https://stackoverflow.com/questions/13681213/what-is-the-difference-between-amazon-sns-and-amazon-sqs