Table of contents

AWS Decoupling, Notification and Monitoring Services

This article explores how AWS supports the scalability and monitoring of applications through decoupling, notification, and monitoring services within your cloud infrastructure.

Coupling refers to the dependencies between components in an application. It can be classified into two types:

  • Tight Coupling:
    • Common in monolithic applications, where all components are interdependent.
    • Challenges:
      • High dependency among components.
      • Performance issues arise if one component is faster or slower than others.
      • A failure in one component can lead to the entire system failing.
  • Loose Coupling:
    • Found in microservices architectures, where components operate independently.
    • Advantages:
      • Components can work without waiting for others to complete their tasks.
      • Data and messages move seamlessly between components.
      • Failure or slowness in one component does not impact the rest of the system.
      • Decoupled components can connect but remain independent.
    • Benefits:
      • Improved flexibility and easier maintenance.
      • Increased scalability, resiliency, reliability, and elasticity.

AWS Application Integration Services

AWS Application Integration Services help achieve decoupling and support efficient communication between components with various services for queues, notifications, and event handling

Amazon Simple Notification Service(SNS): a fully managed service that allows you to set up, operate, and send notifications to multiple recipients.

  • Features:

    • Supports notifications via SMS text messages or email.
    • Enables applications to send messages that are immediately delivered to subscribers of other applications.
  • Uses a Pub-Sub Model:

    • Applications publish or push messages to a topic.
    • Subscribers receive messages from the topic.
    • A topic serves as an access point, enabling recipients to subscribe and receive identical copies of the same notification. Image Description
  • Use cases:

    • Ordering Systems: Notify customers or services about order updates and statuses.
    • CloudWatch Alert Notifications: Send real-time alerts based on CloudWatch monitoring data.

Amazon Simple Queue Service(SQS): a distributed message queuing service that facilitates reliable communication between components of an application. Primary service in AWS that is designed for decoupling.

  • Key Features:
    • Allows web applications to queue messages efficiently, enabling one component to produce messages and another to consume them.
    • Utilizes queues as temporary repositories for messages waiting to be processed.
    • Provides fault tolerance, ensuring the system doesn’t crash if a component goes offline.
    • Pull-Based: Consumers retrieve messages from the queue when they are ready to process them.
    • Multiple Access: Multiple components can add messages to and consume messages from the same queue.
    • Asynchronous Processing: Messages are processed asynchronously, allowing for flexibility and scalability.
    • Message Delivery Guarantee: Ensures that each message is processed at least once.
  • Example Use Cases:
    • Money Transfer Applications: Queue and process financial transactions reliably and asynchronously.
    • Ordering Systems: Manage and queue orders between creation and processing systems to decouple interdependencies with each other. Image Description

SQS Standard and FIFO Queues

Standard Queues

  • Default queue type in SQS.
  • Guarantees that each message is delivered at least once.
  • Uses best-effort ordering, meaning messages are generally delivered in the order sent but might occasionally arrive out of order.
  • There is a possibility of duplicate messages being delivered.

FIFO (First-In-First-Out) Queues

  • Ensures strict FIFO ordering, meaning messages are sent and received in the exact order they were added to the queue.
  • Guarantees that each message is processed exactly once, avoiding duplicates.
  • Ideal for scenarios where maintaining the order of messages is critical.
  • Use Case: Banking transactions, where the order of operations is crucial for accurate processing.

SQS Short Polling and Long Polling Short polling and long polling determine how frequently consumers check the queue for messages.

Short Polling

  • Immediately returns a response, even if the queue is empty.
  • Can result in numerous empty responses, which incur costs since AWS charges per response.

Long Polling

  • The consumer waits to poll the queue until a message is available or a specified timeout is reached.
  • Results in fewer empty responses, making it more cost-effective.
  • Generally preferred over short polling due to its efficiency.

Simple E-mail Service(SES): a cloud based e-mail service that enables your application to send richly formatted HTML emails.

  • Features:
    • Supports bulk email sending for large-scale campaigns.
    • Provides tracking for open rates and click-through rates to measure the effectiveness of email campaigns.
  • Sample Use Cases:
    • Sending order or delivery confirmations.
    • Running marketing campaigns with details about new product launches, special offers, or discounts.

Key Difference Between SES and SNS Emails:

  • SES: Sends richly formatted HTML emails, ideal for marketing or detailed communication.
  • SNS: Sends plain text emails, suitable for simple notifications or alerts.

EventBridge: a service that simplifies the creation of event-driven systems, where an event represents a change in state.

  • Key Features:
    • Easily configure tasks to run on a pre-defined schedule(e.g. once an hour or day or at the same time on a specified day, week, or month).
    • Supports events from various AWS services, including:
      • EC2
      • CloudWatch
      • CloudTrail
    • Uses rules to match events and route them to the appropriate target.
    • Targets respond to events by performing actions, such as sending notifications via SNS. Image Description

Monitoring in AWS

Image Description

AWS Cloudwatch: a monitoring service that provides real-time insights into AWS resources and applications.

  • Key Features:
    • Monitors AWS resources and collects real-time metrics.
    • Tracks and collects metrics for resources and applications.
    • Allows creation of alarms to trigger actions or notifications based on specific metrics.
    • Enables creation of custom dashboards to visualize application performance metrics.

AWS X-Ray: a debugging and analysis tool for distributed applications.

  • Key Features:
    • Helps developers troubleshoot the root cause of performance issues and errors.
    • Provides a visualization of an application’s underlying components.
    • Includes an X-Ray service map, offering an end-to-end view of requests as they move through the application.
    • Offers insights to identify and resolve connectivity and performance issues.

If you’re interested in learning more, you can explore the AWS documentation available at this link https://docs.aws.amazon.com/