Professional Documents
Culture Documents
Serverless Computing
Serverless Computing
Figure 2: Deploying the Google cloud function and uploading the file (config.txt)
Figure 3: The Logs
Steps:
1. Initially, a bucket and a VM instance is created. Start the VM and install python and gsutil. The
cloud function needs to have access to Google-cloud-storage. For that do:
2. Write a function ‘cloud_func’ which prints the file name and counts the number of lines present in
the file uploaded to the Google cloud server. (Fig-1)
3. The function is then deployed to the Google Cloud Function which gets triggered when the file is
uploaded to the GCS.
4. (Fig-3) Logs are then checked using: gcloud functions logs read --limit 50
Q-2 Deploying a Google cloud function (Print Hello World and get sum of first N Fibonacci numbers)
‘Hello-World’
To deploy the function: gcloud functions deploy hello_world --runtime python310 --trigger-http --
allow-unauthenticated
Parameter meaning:
3. --runtime python310: To specify the runtime environment for the function. Here, we are using
python version 3.10
4. --trigger-http: To specify the trigger for a function. Here the function gets triggered by a HTTP
request.
Results:
2. Complete the calculate_fibonacci function which returns the sum of first N Fibonacci numbers.
3. Then deploy the return_fibonacci function using: gcloud functions deploy return_fibonacci --
runtime python310 --trigger-http --allow-unauthenticated
4. After deployment, you get an URL. Open that URL in your browser. Give input to that function
Serverless Computing: Server less computing is a cloud computing model where the cloud provider
manages the architecture and allocates the required computing memory automatically as needed to
run the application code. The user doesn’t have to anything related to allocating the computing
resources. In server less computing, it doesn’t mean that there are no servers running, it means that
the servers are still running but the user doesn’t have to manage them. The user just provides the
application code, which then runs on the cloud in response to specific requests. This code by the
user can be written in any programming language. The scaling and availability is managed by the
cloud provider. Some popular serverless computing services include Google Cloud Service, Azure
functions etc.
As a student of Big Data Lab, write a comparative analysis, highlighting the pros and cons, as a
student developer, b/w PaaS, IaaS, SaaS.
Platform-as-a-Service (PaaS): It is a platform which allows users to build, test and deploy their
application without worrying about the underlying infrastructure. The runtime environment is
managed by the cloud provider.
Advantages:
It simplifies the development process, as the user only has to focus on developing
applications.
Automatic scaling, allowing to handle more traffic without any additional resource.
Disadvantages:
Limited customization options available to the user, as there is limited control over
infrastructure.
Higher cost
Infrastructure-as-a-Service (IaaS):It provides the infrastructure to run the application. Virtual
Machine, storage resources are provided to the user, which then the user can use to deploy their
application.
Advantages:
User has more control over the infrastructure, allowing more customization.
Lower cost compared to PaaS and SaaS.
Disadvantages:
Software-as-a-Service (SaaS): The user has access to the application only through a web browser or
an app. The storage, infrastructure, platform and other resources are managed by the cloud
provider.
Advantages:
This allows easy access to the software without any need of setup.
Automatic updates and maintenance of the software.
Disadvantages:
Cloud APIs (Application Programming Interface) is a tool that allows interaction between software
application and cloud computing services. These APIs allows user to access and manage the cloud
resources such as Virtual Machine, storage and databases.
These APIs play an important role in cloud computing landscape by allowing the user to build
applications and then have the added advantage of services provided by the cloud platforms. The
user can access the cloud resources, automate tasks and integrate the cloud services with other
applications. Some of the important benefit of cloud APIs include flexibility, scaling, automation and
easy integration of application with other cloud services.
In summary, cloud APIs are very important component of the cloud computing landscape providing
the users with necessary tools to build and deploy software that are scalable, flexible and cost-
effective.