AWS part-1

Introduction to Amazon Web Services & AWS Compute Services

Cloud Computing Model relates to a real life scenario is that of a Coffee Shop, Where in a customer enters asks for the Coffee and get it, he doesn't have to make it by himself and worry about ingredients. Whenever there is more customers in the coffee shop you can get more employees on the work. Similarly, the When a Company wants to deploy the application on a server the then they just pays for it and get the resources from AWS. Also you can demand as many resources as your need within a few minutes.

So, What is Cloud Computing in short?

Cloud Computing is a delivery of on-demand IT resources with pay-as-you go model, you don't need to maintain the data centers of your own, worry about the traffic, calculate it's traffic.

Types of Cloud Computing Model:

  1. Cloud Based Deployment: Here in this case, the deployment is done completely on the cloud. Everything from running all the parts of application, Migrating the existing cloud based application, developing on the cloud itself, can be done here.

  2. On-premises Deployment: Here in this case, the company itself creates it's own resources such data centers and server, Using the virtualization and application management tools. This kind of a model is used in a legacy application(outdated application but still used and important to them).

  3. Hybrid Deployment: Here in this case, the company chooses to keep the application on there premises resources, while benefiting from the data and analytics services that run in the cloud. This can used in some legacy application, Or maybe used by government who wants to keep their monitoring on there own.

Elastic Cloud Compute Service (EC2)

Amazon EC2 is a virtual server in the cloud, that can be used to run virtual application inside it. It provides a wide range of customization option in different things such as the Compute capacity of the server, Memory for the server, Storage and Some Graphics oriented compute options. It comes with pay-as-you go model, in which you get a highly available and secure, network customization, etc.

Types of EC2 Instances:

  1. General Purpose: Great balance of compute, memory and storage. Used for web server, small and medium databases, backend for enterprise application

  2. Compute Optimized: It has greater capability of computing power, which can be used by many gaming servers, compute intensive web application. Also can be used in batch processing in which many transactions can be verified in one single go.

  3. Memory Optimized: As it is a temporary storage, It has greater capability of storing the data that is needed directly by the CPU in order to process it. This is a high performance memory server which can be used to process large datasets. Suppose you have a large amount of unstructured data that is need before launching the application in that case it can be useful.

  4. Accelerated Compute Optimized: These instances comprises of hardware accelerators and Graphics Cards, that helps in performing the software running on the Instance. These are used in various aspects such as, In calculation of floating point numbers, Game Streaming, Graphics Oriented tasks, Machine learning training model.

  5. Storage Optimized: Storage optimized instances are high performance Storage option wherein you need high input/output from the database, Or using high frequency online transaction processing using the database, Or creating a data ware-housing. They are mainly designed to give tens and thousands of low-latency random input and output operations per second.

Pricing of EC2 Instances:

Pricing or the payment model comes in various types such as do you want a short term usage, Long term commitment, or can reserve a resource for a long term for a permanent usage. As per your usage AWS, has there saving plans for you some of them are as follows:

  1. Reserved Instances: Reserved Instances comes with the commitment plan of 1 year or 3 year and savings up to 75%, In these options you select your compute capacity for the server, Operating System and Region. Once you go with them you cannot change until you stop them. These can be useful when you are sure that you need a consistent server and don't want to make changes into that.

  2. Savings Plan: Savings Plan instances comes with hourly usage commitment of 1 year or 3 year, in which you are charged for the compute capacity that you use per hour with savings upto 72% compared to the on-demand pricing.

  3. Spot Instances: These instances are the best in terms of saving, that saves you up to 90% as compared to usual on-demand pricing. But these comes at a cost that your workload must withstand some interruptions in between. They must not have fixed start and end timings. The instances which are not currently in use are given by AWS. But, two minute before taking the instance, reminder is given so that you can quickly wrap up the work. Some use case are, Batch Processing, Big Data Processing.

Scaling Out the Instances:

  1. Vertical Scaling: Vertical Scaling means adding more resources to the current server such as, increase compute power by adding more vCPU's, adding more memory and storage. These case can occur when you need more performance from your server which it is not getting from current configuration. Suppose you have a website for Generative AI, and suddenly your system crash due low resources. In these case you need scaling but as the demand decreases the resources are reduced to its normal or original form.

  2. Horizontal Scaling: Horizontal Scaling means that adding more VM Instances rather than adding the resources to one single VM. In this case as the number of request increases on one server more such same instances are launched in order to reduce the load on one and decrease the latency in delivering the requested content, to the customer. As the demand and number of requests decrease a threshold marker the number of VM are reduced to original position.

Amazon Elastic Load Balancer:

Amazon Elastic Load Balancer or ELB is a service provided by AWS to redirect web traffic to balance the load across the unused servers and reduce latency. In the above example, we looked at Horizontal Scaling, but after the addition of resources, there must be someone who should redirect the requests evenly across all the VMs. This ensures that no single VM faces heavy traffic. This practice tends to increase the availability and performance expected from your business. In terms of technical aspects, the requests first route to the Elastic Load Balancer (ELB) and then move towards the VMs.

Amazon Serverless: AWS Lambda

Serverless, in terms of cloud services, means that when you want to run the application backend code on top of a server, you can do so easily without worrying about the underlying resources and infrastructure. You just care about developing the code and writing it as efficiently as possible, adding more features to it. Unlike with the EC2 instance where you need to install components and figure out the right amount of resources for your needs, all of this is managed by AWS Lambda. It chooses the correct amount of resources for your code and requirements. Another benefit of serverless computing is the flexibility to scale serverless applications automatically. Serverless computing can adjust the application's capacity by modifying the units of consumption, such as throughput and memory.

Amazon Elastic Container Service (ECS):

Amazon (ECS) is a highly scalable, high-performance container management system that enables you to run and scale containerized applications on AWS. Here you can also use popular container management tool such as Docker. That enables you to build, test, and deploy applications quickly. Docker is a Open-Source tool which comes with both community and subscription based edition. You can use api calls to start and stop the containers. A container is basically an isolated environment in which your application runs with interfering with another application, It runs on top of a virtual machines and thousands of containers can be run on a single machine without configuring each one of them separately for operating systems.

Amazon Elastic Kubernetes Service (EKS):

Amazon (EKS) is a fully managed service that you can use to run Kubernetes on AWS. Kubernetes is open-source software that enables you to deploy and manage containerized applications at scale. In Kubernetes configuration you need to provide certain files such as Deployment file, Service file, Security file, etc., In order to fully manage the ecosystem that you want to create for you highly available application. It's pretty complex topic to get the hands on, having a good understanding of Kubernetes before using it on the Amazon is a good choice.