Compute Service
Fundamentally, the definition of compute is to calculate or to solve a problem. In a physical computer the compute portion is the central processing unit (CPU), or the brains of the computer. In cloud computing, the term compute describes concepts and objects related to software computation. Compute is a generic term used to reference all the resources required for a program to successfully run. These resources include the processing power, memory, and other necessary resources needed for the computational success of the program. For example, applications that run machine learning (ML) algorithms or 3D graphics-rendering functions require many gigabytes of random access memory (RAM) and multiple CPUs to run successfully. In this case, the CPUs, RAM, and graphic processing units (GPU) required will be called compute resources, and the applications will be compute-intensive applications.
Cloud computing
Cloud computing involves delivering computer resources across the internet. You can access much larger amounts of resources, such as memory or computing power, than you could ever build into a single local server or laptop. Unlike buying physical hardware, with cloud resources, you only pay for what you use'. You also have the flexibility, or elasticity, to quickly expand how many or how much resources you use. This elasticity is a primary benefit of using the cloud. You can scale up and scale down your compute power, paying for only what you've used, to meet spikes in application demand.
For example, you might run an ecommerce website and hold a post-holiday sale that triples the normal traffic to your site. When you use the cloud, your environment can automatically add more compute instances, balance the load for incoming traffic, and continue to operate without affecting the customer experience. After the sale is over, you can shrink the amount of resources quickly, for cost savings. When you use the AWS Cloud, you can quickly scale resources to meet demand.
AWS compute options
For compute in AWS, the three most commonly used services are as follows:
1.Compute
2.Container services
3.Serverless services
Each of these options serves a specific function, provides configurable options, and exists to meet a variety of workloads within the AWS Cloud. Sofía begins to explain to John about the three categories of compute used in AWS and how each category maps to specific AWS services. To learn more about the AWS compute services, choose each numbered marker in order.
Serverless Computing
Serverless does not mean servers are never used. Serverless means you're running your code on servers built, operated, and managed by someone else. This frees you from having to buy, build, provision, and manage the hardware and infrastructure to run your code. Serverless always means in the context of app development. Server infrastructure can be used externally by your development team (AWS Cloud).
With serverless apps, there are never instances, OSs, or servers to worry about. AWS manages everything required to run and scale your application. With serverless apps, your developers can focus on the code that sets your business apart. With serverless computing, software development companies can innovate and respond more rapidly to change. Development teams can rush apps to market, collect feedback, and improve their software. They don't have to think about the expense of running or the technical expertise required to maintain the infrastructure.
For example, a tech start-up company creates an application designed to search and filter university courses. To launch its application, the company can use serverless compute resources, and focus its time on refining the application, user experience, and functionality. The money it would have spent on hardware infrastructure can now be invested in a marketing campaign for the new application.
1. Compute Services
Amazon EC2 Instances
Think of instances as virtual computers you use in the cloud. They let you do much of what a physical computer can do. You decide on things like the CPU, memory, and storage you need. You choose the operating system (OS), and it’s your job to keep it secure and updated. You can also change the amount of resources your instance uses whenever you need to.
Amazon Web Services (AWS) looks after the actual hardware and systems that your instance operates on, but AWS cannot see or access what’s on your instance. This means they cannot get to your operating system, passwords, keys, or any of your stored data. With Amazon EC2, you only pay for what you use. Billing starts when your instance begins running, and you’re not billed if the instance is turned off. If it's not running, you don’t have any charges.
2 Containers: Amazon ECS and Amazon EKS
Container images are like packages that hold everything you need to run a program. They include system libraries, settings, code, and all the dependencies required.
When an application is packaged in a container, it can be moved from one computer to another without any issues. This is because everything it needs to operate is included inside the container. So, the application doesn't rely on the computer it's running on.
The great thing about a self-contained application is that it can run on an EC2 instance or use AWS Fargate to run serverlessly. AWS Fargate is a service you use with Amazon ECS to run containers without having to deal with servers or managing EC2 virtual machines. Fargate takes away the need to set up, manage, or scale groups of virtual machines for the containers.
Think of a container like a suitcase. You fill it up with everything the application needs to function. Inside this suitcase are all the software tools, code, libraries, and settings. No matter where you take this suitcase, the application will function the same way since all necessary components are packed inside. You can place the container on Amazon EC2 or use a serverless service, and it will still run. It can even handle changes in hardware. A container is smaller and easier to transport than an EC2 instance, but bigger than just a piece of code.
Containers are tools that are simple to use, quick, and very portable. They include all the essential files, ensuring that your application performs consistently every time, no matter where it’s run. This makes it easier to rapidly deploy, update, and scale your applications when needed. You won’t have to worry about operating system updates or security changes affecting your applications. This leads to faster and more efficient development processes. Containers support consistent performance, and because they manage everything the app needs, it allows developers to focus more on creating and improving applications instead of managing system issues.
key features:
The application is packaged in a way that allows you to manage it and everything linked to it, such as rules, security, and setup.
They can easily be moved to different operating systems or hardware configurations. You can work with them in various stages, like development, testing, pre-production, and production.
They can run without time limits, which is perfect for applications that need to operate for more than 15 minutes or that have to start immediately when needed.
Containers start faster than Lambda or Amazon EC2 because there's no wait time at the beginning.
There are no restrictions on the size of containers; they can be as big or small as your needs require.
They are beneficial for transforming a large, traditional application into smaller, separate units called microservices. This change makes the application easier to expand and more dependable.
3.Serverless: Lambda
With Lambda, you no longer need to worry about setting up or managing servers. All you need to do is write your code, and Lambda automatically provides the computing resources it requires to run. It handles everything needed to execute your code based on incoming requests or events and adjusts resources automatically as required. You have the option to set your code to be triggered automatically by other AWS services, or you can directly call it from any web or mobile app. This means you can focus more on your application while Lambda deals with the backend resources for you.
Amazon EC2
Amazon EC2 lets you manage your IT systems with a lot of detail and control. You can choose from over 500 different types of virtual servers, called instances. These instances come with the latest processors, storage options, operating systems, and networking features. Just like with physical servers, you can customize these EC2 instances to your liking. There are also EC2 instances designed for specific tasks or performance needs. This ensures your applications can run on an instance that matches the type of work you need to do.
When you choose to use EC2 instances, here is a list of benefits that you gain:
- With Amazon EC2, creating and launching a new server is simple and quick. Unlike traditional servers, there's no need to physically set up the server, connect any cables, or worry about updating hardware drivers. It's a hassle-free way to get your server up and running efficiently.
- You can adjust the capacity whenever needed. If you need more memory, processing power, or storage space, you can easily add it. This flexibility allows you to increase or decrease resources based on your requirements.
- Instances promise to be available at least 99.99% of the time, which is often called "four nines." If you want to know more about AWS and its availability, you can look at the Amazon Compute Service Level Agreement for detailed information.
- Amazon EC2 provides a variety of instances, each suited for different types of tasks. There are memory-optimized instances for tasks needing lots of RAM, compute-optimized instances for tasks requiring high CPU performance, storage-optimized instances for tasks involving large amounts of data, and accelerated computing instances for tasks using high-performance processes. There are also general-purpose instances for everyday use.
- Various instance types are available with different pricing options, so you can choose the best option to fit your business requirements. These options include On-Demand Instances, Reserved Instances, and Spot Instances.
- Amazon EC2 gives you complete control over the instance, down to the root level. You can manage the instance as you would manage a physical server.
- You can use instances for long-running applications, especially those with state information and long-running computation cycles
Serverless
One of the main advantages of cloud computing is that it hides the physical parts of computer systems from you. This means you do not have to manage the hardware yourself. In a serverless setup, this hiding goes even further. Not only are the hardware parts hidden, but also the virtual instances and the operating systems that AWS Lambda uses are not visible to you. Because of this higher level of hiding, you can concentrate more on developing your application code. You save time because there is no need to worry about building, maintaining, or updating the physical hardware, the hosts, or the operating systems.
Key features
- Fast Development
- Pay for value
- Short -Lived Applications
- Event-driven Applications
- Automatic Scalling
- Redundancy and resilience
Lambda function
The code that you run on Lambda is called a Lambda function. Think of a function as a small, self-contained application. After you create your Lambda function, it is ready to run as soon as it is initiated.
- Each function includes your code and some associated configuration information, including the function name and resource requirements.
- Lambda functions are stateless, with no affinity to the underlying infrastructure.
Lambda can rapidly launch as many copies of the function as needed to scale to the rate of incoming events.
In this example, a person takes a picture and uploads it to an Amazon S3 bucket. When the photo goes into the bucket, it starts an "upload to bucket" event. This event activates a Lambda function. The Lambda function then resizes the photo so it can be used in different sizes for the web, mobile phones, and tablets. No one needs to do anything by hand. You can add more functions to do other tasks, like putting the image name into a database, copying the images to another place, or updating an image on a website.
What is AWS Step Functions?
AWS Step Functions is a service provided by Amazon Web Services. It allows you to organize and manage various AWS services to create workflows, all without the need for servers. With Step Functions, you can set up and run processes that involve sequences, make decisions using branches, have retries for tasks if needed, and run several tasks at the same time. This can be done without writing any special code to control the flow, making it easier to manage how tasks are completed.
What does it do?
Think of Step Functions as a flowchart or automation engine that tells your AWS services what to do and in what order.
- Visual Workflow: You define your workflow using Amazon States Language (ASL) — a JSON-based language.
- State Machine: The workflows are called state machines, and each "step" is a state (like a task, a choice, a wait, etc.).
- Managed Execution: AWS automatically manages the execution, retries, error handling, and state tracking.
Common Use Cases
- ETL (Extract, Transform, Load) processes
- Microservice orchestration
- Data processing pipelines
- Order processing workflows
- Machine learning model workflows
How it Works
- Create a state machine with steps like:
- Task: Run a Lambda function or other service
- Choice: Add if/else logic
- Wait: Add a delay
- Parallel: Run tasks in parallel
- Fail/Pass: Handle success/failure gracefully
- Start execution by passing input data (e.g., JSON).
- Step Functions tracks the state of the workflow and moves step by step.
AWS Elastic Beanstalk
Developers can simply upload their application with Elastic Beanstalk. After that, Elastic Beanstalk takes over by managing tasks like providing enough resources, balancing the incoming workload, adjusting the scale automatically, and monitoring the application's well-being. This allows developers to focus more on building their application without needing to worry about technical tasks like setting up servers or managing how the application grows.
Elastic Beanstalk automatically tailors the size of your application based on its current needs with its flexible Auto Scaling settings. For example, if your application uses a lot of CPU power, Elastic Beanstalk can automatically change the scale to match the demand. This ensures your application can handle large workloads or sudden traffic increases while keeping expenses down.
Amazon Lightsail
Amazon Lightsail offers a service where you can rent a virtual private server (VPS). Think of a VPS as a computer in the cloud, which you can use to run websites and web applications. It ensures your websites are secure and always available. If you want to start building and hosting applications on the AWS Cloud, Lightsail is a simple way to begin.
Lightsail gives developers access to computing power, storage, and networking options needed to set up and run websites and web apps in the cloud. It provides tools to help you launch your project quickly at a straightforward, affordable monthly fee. With Lightsail, you get virtual machines, containers, databases, a content delivery network (CDN), load balancers, Domain Name System (DNS) management, and more.
How does Lightsail differ from Amazon EC2? Lightsail is designed for low-cost, easy-to-use cloud resources suitable for simpler tasks, perfect for beginners on AWS. In contrast, Amazon EC2 is suited for more extensive, customizable computing work in the cloud. EC2 can handle larger and more complex operations compared to Lightsail.