Introduction to Cloud Computing

Cloud computing is a transformative technology that allows businesses and developers to build, deploy, and manage applications through virtualized environments offered by cloud providers. Cloud development focuses on leveraging cloud infrastructure to run and manage applications. This shift from traditional on-premises infrastructure to the cloud enables more dynamic, scalable, and flexible development. It’s key features are:
1. Scalability: Cloud platforms allow developers to scale resources up or down automatically or manually based on demand, ensuring that applications can handle varying loads without over provisioning.
2. Flexibility: Cloud services offer a broad selection of tools and environments for building apps in any programming language, framework, or platform, making it easier to adapt to evolving project needs.
3. Cost-efficiency: The pay-as-you-go pricing model ensures that developers only pay for the resources they actually use, reducing waste and enabling more efficient cost management.
4. Global Accessibility: Applications deployed in the cloud can be accessed globally, enabling organizations to serve customers from multiple regions without worrying about local server infrastructure.
Common Cloud Providers are:
1. Amazon Web Services (AWS): Offers a comprehensive range of cloud services like computing power, storage, machine learning, and analytics.
2. Microsoft Azure: A cloud computing service with solutions that span AI, machine learning, IoT, and DevOps.
3. Google Cloud Platform (GCP): Known for its powerful data analytics, machine learning tools, and developer-friendly services.
We’ll introduce you to the Cloud with a simple exercise! The task is to deploy a Node.js HTTP Server on AWS so that everyone can send requests to it instead of it just running locally on your device. Trust me, you don’t want to be the type of guy that sends http://localhost:3000 when asked to share the link of your project!
What is a server?
A server is a computer or software system that provides resources, data, services, or programs to other computers, known as clients, over a network. Servers can perform various roles, such as hosting websites, managing databases, running applications, or providing email services. In the context of web development, for example, a server is responsible for receiving client requests (e.g., from a browser), processing them, and sending back responses like HTML pages or data in formats such as JSON.
We will now learn how to host a Node.js HTTP server on AWS EC2. Note that for this you need to make an AWS account which requires you to put your credit card info. The service that we’ll be using will be free for over a year for our learning purposes.
Step 1: login to your AWS console

You may see a screen like this, make sure that your region is set to mumbai on the top right corner.
Step 2: Click on services on the top right corner -> Compute -> EC2

EC2 stands for Elastic Compute 2 here, this helps us get a Virtual Machine in the Cloud where we can host our Node.js HTTP server
Step 3: Launch an instance by clicking on the launch instance button

Step 4: You will see a menu like this

Name your instance whatever you like and select Amazon Machine Image to be Ubuntu for now. The Amazon Machine Image helps you select what Operating System will your Virtual Machine run on.
Step 5: on scrolling below, you will see a menu like this:

There are many Amazon Machine Image families such as t2, t3, c5 these represent virtual machines of various hardware configurations which are applicable for various use cases but we’ll go ahead with t2.micro for the sake of simplicity because we don’t need that much hardware.
Step 6: on scrolling below, you will see a menu like this:

Key Pair logins are there for us to SSH into our instance so that we can access it remotely from the browser but for now we can use the AWS console to use our instance via web. Note: If in the future you make a key to SSH into your server it should not be shared with anyone for security purposes!
Step 7: on scrolling below, you will see a menu like this:

We will allow traffic from anywhere for simplicity’s sake but in a real world scenario this is configured properly to accommodate the static IP of an organization for security purposes.
Step 8: launch the instance without the key pair for now since we’ll only be accessing the Instance through web via EC2 Instance connect for now, note that this is NOT how things work in Real World Production Scenarios this is just done to demonstrate an exercise.

Step 9: you will then see a page like this:

Choose the connect to your instance option here
Step 10: Connect to the instance using EC2 instance connect.

Step 11: You will see a terminal like this, this is where the importance of knowing how to navigate a terminal and basic Linux comes in handy for Cloud Computing.

The cloud is predominantly powered by Linux because of its open-source nature, flexibility, and scalability. Linux's ability to handle diverse workloads efficiently makes it ideal for cloud infrastructure. Major cloud providers like AWS, Google Cloud, and Azure rely on Linux for its robust security, cost-effectiveness, and extensive developer community, which ensures continuous innovation and reliability in cloud environments.
Git Comes installed by default in Ubuntu Instance, use it to download the source code for our HTTP server locally via:
$ git clone https://github.com/aayush0325/aws-test-server.git
$ cd aws-test-server
$ ls

You can see that we have the basic source code installed in our instance, however we need to install Node.js and npm in our instance to be able to run this code.
For that run:
$ sudo apt update
$ sudo apt install nodejs #press Y when prompted
$ sudo apt install npm #press Y when prompted
To check whether the Node.js and npm has installed correctly run:
$ node -v
$ npm -v
This should list the versions of npm and Node.js installed. If it gives an error please recheck the installation process.
To download the dependencies run:
$ npm install

Now Start the server by running:
$ node index.js

/* index.js -
this code is already written in the repository that you cloned feel free to go through
https://expressjs.com/ and play around with this
*/
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.json({
message: "Hello from AWS!"
})
})
app.listen(3000, () => console.log('Listening to port 3000'))
This starts the server which is listening to the port 3000 of our Virtual Machine for requests, to access this we should navigate to http://<PUBLIC_IP_OF_INSTANCE>:3000 (see bottom right of the previous image).
However when we do that, we won’t get any response. This is because the port 3000 of our machine needs to be exposed to capture requests.
To do that:
Go to AWS Console Dashboard again make sure that your location is set to mumbai
In the recently visited tab click on EC2 This will open the EC2 Dashboard which will look like this

You can see that in the Instances (Running) we have a running instance, click on that
You can see that the cops community instance that we started is still running to configure its security, click on the instance ID of your instance.
This will open an instance summary which will look like this:
Scroll below and choose the security tab, you should see something like this
Click on the security groups link, You may see something like this
Here we have to edit inbound rules to allow incoming traffic from anywhere to port 3000
Click on edit inbound rules
Add a custom TCP Rule, set the port range to 3000 and set the source to anywhere. This exposes port 3000 of our machine to receive traffic from anywhere.
This is how your inbound rules should look like, Save the rules.
You will land on this page, click on the EC2 Dashboard on the top left again, Click on Instances (Running), Click on instance Id, you will land on the summary page again which may look like this
Click on Connect, Connect using EC2 instance connect like we did previously, and restart the server if it was closed using $ node index.js
Copy the public IP that you can see below the terminal
In your browser, search for http://<YOUR_PUBLIC_IP>:3000 (http not https !!!! since we haven’t configured SSL certificates yet)
You will see the message, “Hello from AWS” from our server
Our Server is running properly! Kudos for coming up this far, once you’re done playing around with the instance it is very important to shut it down so that it doesn't rack up any bills unknowingly!!!!! IMPORTANT PLEASE DON’T SKIP OR IT MAY COST YOU MONEY FROM YOUR CREDIT CARD IF YOUR FREE TIER HAS EXPIRED!!!!!
Go to EC2 Dashboard → Click on Instances (running)
Right click on instance ID
Before stopping instance we must also stop any associated resources
Click on the volume ID and press stop
You should see that the instance is Stopped, this may take some time, be patient!!!
In the new tab that has opened, (You can also go here by scrolling down on the menu on left and selecting volumes)
Click on the volume id and Force Detach, type in detach in the menu for confirmation
Once you do that right click again
And delete volume.
Go to instances tab again by scrolling up on the menu on left and right click on Instance ID of the instance that you don’t need anymore.
Click on terminate instance.
After a while you should see that the instance is terminated
Congratulations on hosting your first Express app on AWS EC2—what a fantastic milestone in your cloud computing journey!
As an exercise I urge you all host a server in any language of your choice that says your name when searched for and post it in the COPS community groups!
How is this used in the real world production scenario?
Types of Cloud Services:
Cloud services have revolutionized the way businesses and individuals access and manage technology resources. They provide on-demand access to computing power, platforms, and software over the internet, eliminating the need for traditional on-premises infrastructure. These services are categorized into three main types:
1. Infrastructure as a Service (IaaS): Provides virtualized computing resources over the internet. Examples include AWS EC2 and Azure Virtual Machines.
- Platform as a Service (PaaS): Offers a platform allowing developers to build, test, and deploy applications without worrying about the underlying infrastructure. Examples include AWS Elastic Beanstalk and Google App Engine.
3. Software as a Service (SaaS): Delivers software applications over the internet, typically on a subscription basis. Examples include Google Workspace and Microsoft Office 365.
Development Practices:
Modern development practices focus on enhancing scalability, efficiency, and agility in application development. Approaches like Microservices Architecture, Containerization, Continuous Integration/Continuous Deployment (CI/CD), and Serverless Computing empower developers to build, deploy, and manage applications with greater flexibility and speed, leveraging automation and cutting-edge tools for streamlined workflows.
1. Microservices Architecture: A design approach where applications are broken down into smaller, independent services that communicate through APIs. This improves scalability and ease of management.
2. Containerization: Tools like Docker allow applications to run in isolated environments called containers, ensuring consistency across different deployment environments and improving resource efficiency.
3. Continuous Integration/Continuous Deployment (CI/CD): A development practice that involves automating the testing, building, and deployment of applications to ensure rapid iteration and a smooth release process.
4. Serverless Computing: Serverless architectures enable developers to write code without managing infrastructure. Functions are executed in response to events, with cloud providers handling scaling and infrastructure concerns. Examples include AWS Lambda and Azure Functions.
Advantages of Cloud Development:
Cloud development offers significant advantages, enabling teams to create and deploy applications more efficiently. By leveraging the cloud, developers benefit from faster innovation, improved collaboration, and reduced time-to-market through streamlined infrastructure and readily available pre-built services. This accelerates development processes and fosters greater productivity.
Faster Innovation: Cloud services reduce infrastructure management, letting developers focus more on writing code and developing features.
Improved Collaboration: Cloud platforms enable team members across different geographies to collaborate more effectively through shared environments.
Reduced Time-to-Market: Cloud platforms offer pre-built services that allow developers to quickly integrate functionality like authentication, storage, and machine learning into applications.
Cloud development not only improves efficiency and scalability but also accelerates innovation by allowing teams to focus on the business logic and features, rather than the underlying infrastructure. As this week’s exercise, we’ll learn how to host a small server on AWS EC2 using it’s GUI
But this is just the beginning. The world of cloud computing is vast and full of opportunities to grow your skills. Next, you can dive deeper into DNS and networking to understand how web traffic reaches your application, containerization with tools like Docker to make your app more portable, and container orchestration with Kubernetes to manage your deployments at scale.
You'll also encounter exciting challenges like scaling your app to handle increased traffic, setting up a reverse proxy for load balancing and security, and configuring your domain for a professional touch. Don’t forget to explore SSL certificate management to secure your app with HTTPS—it’s crucial for building user trust.
Each of these topics adds layers of resilience, performance, and professionalism to your applications. Take it one step at a time, experiment, and don’t be afraid to break things—that’s how you learn!
Best of luck, and may this be the first of many successful deployments in your cloud computing journey!

