> For the complete documentation index, see [llms.txt](https://awsarch.adot8.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://awsarch.adot8.com/module-13.md).

# Module 13

{% hint style="info" %}
In this topology, the amount of requests to the backend can create a bottleneck of requests this crashing the servers. This is called **Tight Coupling** (three tier arhitecture)
{% endhint %}

<figure><img src="/files/5YDP1l6N2284mXhc1rCB" alt=""><figcaption></figcaption></figure>

* We want to decouple this architecture to loosen it up so nothing gets bottlenecked&#x20;

<figure><img src="/files/oTSMhtMOZjYcUYuAsEYE" alt=""><figcaption><p>Loosen like ur ...</p></figcaption></figure>

### Amazon Simple Queue Service (SQS)

* Is a fully managed message queueing service
* Helps integrate and decouple distributed software systems and application components
* Provides highly available, secure, and durable message-queueing capabilities
* Provides an AWS Management Console interface and a web services API

Wilmer said "remember for the exam"

{% hint style="warning" %}

* Visibility Timeout: After sending the first 5 messages(user-defined), it won't take requests from any other consumer for **30 seconds**(user-defined)
* Max message size: 256kb - only sending metadata
  {% endhint %}

#### SQS Components

<figure><img src="/files/m1kXTBTlbYeIjoQfguPd" alt=""><figcaption></figcaption></figure>

#### Example:

<figure><img src="/files/QeYIJEgXcei3dG741M6h" alt=""><figcaption></figcaption></figure>

#### Queue types

**Standard Queue**

<figure><img src="/files/zjm9hX960TEJrw4MKBp8" alt=""><figcaption></figcaption></figure>

* At-least-once delivery
* Best-effort ordering
* Nearly unlimited throughput

First in First Out (FIFO)

<figure><img src="/files/wMZMY5swpBzn84qp5Shp" alt=""><figcaption></figcaption></figure>

* Exactly once processing
* High throughput

#### SQS Operations

<figure><img src="/files/DHkdp7JjMv731OrwaUyH" alt=""><figcaption></figcaption></figure>

### Amazon Simple Notification Service (SNS)

* Is a fully managed pub/sub messaging service
* Helps decouple applications through notifications
* Provides highly scalable, secure, and cost-effective notification capabilities
* Provides an AWS Management Console interface and a web services API

#### Types of SNS Subscribers

<figure><img src="/files/Uoq5Dcl3sTLxvTLDfQMa" alt=""><figcaption></figcaption></figure>

#### Example:

<figure><img src="/files/3j774EH3nkHCiyjOIzGU" alt=""><figcaption></figcaption></figure>

#### SNS and SQS Differences

| SNS                     | SQS                      |
| ----------------------- | ------------------------ |
| Publisher -> Subcriber  | Producer -> Consumer     |
| One to many             | One to one               |
| Push (passive)          | Pull (active)            |
| Message persistence: NO | Message persistence: YES |

{% hint style="info" %}
Amazon MQ is a message broker service

![](/files/Ykyriov770gjxgwGioXp)
{% endhint %}
