DEV Community

Cover image for Cloud Computing #Day4
Giriraj Roy
Giriraj Roy

Posted on

Cloud Computing #Day4

In this article I will try to quickly cover the Amazon Messaging and Queuing services, and explore the lands of a few more additional services.

The Flaw:

In the process of accepting instructions or requirements to passing the requirements to the server both the systems will have to be on sync. At some point of time if the synchronisation is affected due to any unavoidable reason, such as the server is down the whole process stops and cannot proceed further. A much better process would be to introduce some sort of buffer or queue into the system. Hence the server or instance instead of handing the instructions directly would follow some sort of buffer, like an order board in a restaurant and the chef being the instance.

The idea of placing messages into a buffer is called messaging and queuing.

image

This is where AWS introduced a message queue. Messages are sent into the queue by Application A and they are processed by Application B. If Application B fails, Application A doesn't experience any disruption. Messages being sent can still be sent to the queue and will remain there until they are eventually processed. They are loosely coupled. This is what AWS aims to achieve with its architectures. And eventually brings me to two AWS services that can assist in this regard:

  • Amazon Simple Queue Service or SQS
  • Amazon Simple Notification Service or SNS.

image

Monolithic Application And Microservices

Applications are made of multiple components. The components communicate with each other to transmit data, fulfill requests, and keep the application running.

Now we have two approaches to combine the elements. The Monolithic Architecture where the components including databases, servers, the user interface, business logic, all are tightly coupled. In this approach to application architecture, if a single component fails, other components fail, and possibly the entire application fails.

image

The second approach aims to help maintain application availability when a single component fails, that is you can design your application through a microservices. In a microservices approach, application components are loosely coupled. The loose coupling prevents the entire application from failing.

image

When designing applications on AWS, it is advisable to take a microservices approach with services and components that fulfill different functions. Two services facilitate application integration i.e. Applicatoin A and Application B in the previous example are: Amazon Simple Notification Service (Amazon SNS) and Amazon Simple Queue Service (Amazon SQS) approach.

Amazon Simple Notification Service (Amazon SNS)

Amazon Simple Notification Service (Amazon SNS) is a publish/subscribe service. Using Amazon SNS topics, a publisher publishes messages to subscribers.

In Amazon SNS, subscribers can be web servers, email addresses, AWS Lambda functions, or several other options.

Amazon Simple Queue Service (Amazon SQS)

Amazon Simple Queue Service (Amazon SQS) is a message queuing service.

Using Amazon SQS, you can send, store, and receive messages between software components, without losing messages or requiring other services to be available. In Amazon SQS, an application sends messages into a queue. A user or service retrieves a message from the queue, processes it, and then deletes it from the queue.

Serverless Computing

I would like to revisit the topic of serverless computing, which is a service that lets you run virtual servers in the cloud. The term “serverless” means that your code runs on servers, but you do not need to provision or manage these servers. With serverless computing, you can focus more on innovating new products and features instead of maintaining servers. Another benefit of serverless computing is the flexibility to scale serverless applications automatically. Serverless computing can adjust the applications' capacity by modifying the units of consumptions, such as throughput and memory.

An AWS service for serverless computing is AWS Lambda.

AWS Lambda

AWS Lambda is a serverless compute service that runs the code in response to events and automatically manages the underlying compute resources for the client. These events may include changes in state or an update, multiple events, such as HTTP requests via Amazon API Gateway, modifications to objects in Amazon Simple Storage Service (Amazon S3) buckets, table updates in Amazon DynamoDB, and state transitions in AWS Step Functions. AWS Lambda can be used to extend other AWS services with custom logic, or create your own backend services that operate at AWS scale, performance, and security.

Lambda has its key highlights including server and operating system maintenance, capacity provisioning and automatic scaling, code and security patch deployment, and code monitoring and logging.

How Lambda Works

image

Another additional service is Containerization of applications.

Containers

Containers provide you with a standard way to package your application's code and dependencies into a single object. It is the orchestration service that helps you to deploy, manage, and scale your containerized applications. They smoothen the workflow with security, reliability and scalability.

Amazon provides two containerized services :

  • Amazon Elastic Container Service (Amazon ECS) : This is a highly scalable, high-performance container management system that enables you to run and scale containerized applications on AWS. Amazon ECS supports Docker containers.
  • Amazon Elastic Kubernetes Service (Amazon ECS) : This is a fully managed service that you can use to run Kubernetes on AWS.

There is also another service AWS Fargate.

image

AWS Fargate is a serverless compute engine for containers. It works with both Amazon ECS and Amazon EKS.
When using AWS Fargate, you do not need to provision or manage servers. AWS Fargate manages your server infrastructure for you. You can focus more on innovating and developing your applications, and you pay only for the resources that are required to run your containers.

Top comments (0)