Amazon Web Services – Introduction to Simple Queue Service(SQS)
This article will provide you with an introduction to AWS SQS. We will cover the difference between the queues and create our own.
What is SQS?
A queue is a place where you can store your messages until they are extracted from the queue or expired. Queues are used to store textual information so it can be received and used by a consumer later on.
The consumer is something that is getting a message from a queue. It can be anything that is able to make an API call to SQS (application, microservice, human, etc…). Using this paradigm we implement decoupling.
The decoupling allows processing incoming requests later on. So when the consumer is overloaded it will just wait before getting another message. This way our applications become more fault-tolerant.
Amazon Simple Queue Service(SQS) is a fully managed queue service in the AWS cloud.
Types of Queues:
There are only two types of queues in SQS:
- First-in-first-out(FIFO) – in this queue the order of messages is preserved. So if you receive a message from the queue you will get the oldest message. This queue also guarantees that the message will be delivered only once.
- Standart queue – in this queue messages are delivered randomly. Also, a message can be delivered multiple times. So you shouldn’t rely on order and only one-time delivery in this type of queues.
Creation of SQS via AWS console:
Follow the below steps to create a SQS using the AWS console:
- Open AWS console and type “SQS” in the search bar. And select it.
- Then hit “Create queue”. You should see the following screen:
Every field has an Info clause. You can click on it and read about it if curious.
- Let’s give our queue ‘geeky_queue’ name and hit “Create Queue”. For other fields defaults are fine.
Congratulations! We just created our first queue.