Saturday, November 17, 2018

AWS for Developers and Application Architects - Part 5 - AWS EC2 Container Service - Fargate

I am going to start couple of blogs to cover AWS(Amazon Web Services) concepts from developer point of view. Here is part 5, Refer Part 4 here. More to come

Amazon EC2 Container Service (ECS) supports Docker containers and uses a managed cluster of Amazon EC2 instances. ECS provides an API to launch and manage containers in a cluster. It also enables the use of standard AWS features, such as security groups, Elastic Load Balancing (ELB), Elastic Block Store (EBS), and Identity and Access Management (IAM). There is no additional charge for Amazon EC2 Container Service; users pay only for AWS resources, for example, EC2 instances.

As of now, it only supports Docker

Amazon ECS has two modes: Fargate launch type and EC2 launch type. With Fargate launch type, all you have to do is package your application in containers, specify the CPU and memory requirements, define networking and IAM policies, and launch the application. EC2 launch type allows you to have server-level, more granular control over the infrastructure that runs your container applications. With EC2 launch type, you can use Amazon ECS to manage a cluster of servers and schedule placement of containers on the servers. Amazon ECS keeps track of all the CPU, memory and other resources in your cluster, and also finds the best server for a container to run on based on your specified resource requirements. You are responsible for provisioning, patching, and scaling clusters of servers. You can decide which type of server to use, which applications and how many containers to run in a cluster to optimize utilization, and when you should add or remove servers from a cluster. EC2 launch type gives you more control of your server clusters and provides a broader range of customization options, which might be required to support some specific applications or possible compliance and government requirements.


Fargate is a compute engine for Amazon ECS that allows you to run containers without having to manage servers or clusters. With AWS Fargate, you no longer have to provision, configure, and scale clusters of virtual machines to run containers. This removes the need to choose server types, decide when to scale your clusters, or optimize cluster packing. AWS Fargate removes the need for you to interact with or think about servers or clusters. Fargate lets you focus on designing and building your applications instead of managing the infrastructure that runs them

AWS for Developers and Application Architects - Part 4 - SQS and SNS

SNS(Simple Notification Service) : SNS is Amazon Simple Notification Service is fully managed push notification service that lets you send individual messages or to bulk messages to large numbers of recipients. Amazon SNS makes it simple and cost effective to send push notifications to mobile device users, email recipients or even send messages to other distributed services.
A distributed publish-subscribe system. Messages are pushed to subscribers as and when they are sent by publishers to SNS ,SNS supports several end points such as sms, http end point, email and SQS. If you want unknown number and type of subscribers to receive messages, you need SNS.
With Amazon SNS, you can send push notifications to Apple, Google, Fire OS, and Windows devices , You can use SNS to send SMS messages to mobile device users in the US or to email recipients worldwide.
Amazon AWS SQS( Simple Queue Service) 
SQS is distributed queuing system. Messages are not pushed to receivers. Receivers have to poll SQS to receive messages. Messages can't be received by multiple receivers at the same time. Any one receiver can receive a message, process and delete it. Other receivers do not receive the same message later. Polling inherently introduces some latency in message delivery in SQS unlike SNS where messages are immediately pushed to subscribers.
SQS is mainly used to decouple applications or integrate applications. Messages can be stored in SQS for short duration of time (max 14 days). SNS distributes several copies of message to several subscribers. For example, lets say you want to replicate data generated by an application to several storage systems. You could use SNS and send this data to multiple subscribers, each replicating the messages it receives to different storage systems (s3, hard disk on your host, database, etc.).