[ SRE_ARENA ]
MESSAGING (SQS, SNS, EVENTBRIDGE)

Messaging: SQS, SNS & EventBridge

DOWNLOADING CONCEPT: 1. THE PROBLEM WITH REST APIS...
  • ↳When you build microservices, the first instinct is to have them talk via HTTP (REST).
  • ↳If a user buys a shirt, the Checkout Service sends an HTTP POST to the Inventory Service, which sends an HTTP POST to the Email Service.
  • ↳This creates Tight Coupling and Cascading Failures.
  • ↳If the Email Service is down, the Checkout Service hangs waiting for a response, eventually timing out and failing the customer's entire order just because a receipt couldn't be sent.
  • ↳This is unacceptable.
▲ LIVE INCIDENTA developer complains that their SQS queue is broken. The worker reads a message, successfully processes it, but 30 seconds later, the exact same message appears in the queue again and is processed a second time.
sre@arena:~/cloud-messaging
sre@arena:~$ aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/123/my-queue --attribute-names All