Building applications from individual components that each perform a discrete function is a best practice that improves scalability and reliability. Using message queues, you can send, store, and receive messages between application components at any volume, without losing messages or requiring other services to be always available.

Message queues offer several options that allow you to specify how messages are delivered, prioritized, and secured, described here. Queues can also be combined with Pub/Sub messaging in a fanout design pattern.

Getting started with Amazon Simple Queue Service (SQS) takes just three simple commands.

Most message queues provide both push and pull options for retrieving messages. Pull means continuously querying the queue for new messages. Push means that a consumer is notified when a message is available (this is also called Pub/Sub messaging). You can also use long-polling to allow pulls to wait a specified amount of time for new messages to arrive before completing.

Message queues may store multiple copies of messages for redundancy and high availability, and resend messages in the event of communication failures or errors to ensure they are delivered at least once.

A dead-letter queue is a queue to which other queues can send messages that can't be processed successfully. This makes it easy to set them aside for further inspection without blocking the queue processing or spending CPU cycles on a message that might never be consumed successfully.

Typically you can assign a priority to a message to determine where in the queue the message is added, to make sure that higher priority message get bumped to the front of the line and processed first.

Poison pills are special messages that can be received, but not processed. They are a mechanism used in order to signal a consumer to end its work so it is no longer waiting for new inputs, and is similar to closing a socket in a client/server model.