You are on page 1of 16

PRACTICAL FILE

ON

“Cloud Application Development”


Submitted in partial fulfillment of the requirements for the award of

degree of
MASTER OF COMPUTER APPLICATION

To

UTTARANCHAL SCHOOL OF COMPUTING SCIENCES

UTTARANCHAL UNIVERSITY, DEHRADUN

(Session: 2023-2024)

Submitted To: Submitted By:


Mr. Anoop Chamoli Dhananjay Yadav
(Assistant Professor) Roll no-30
Enroll no-
UU2220000030
INDEX

S.NO PRACTICAL PAGE DATE SIGNATURE

1. What is Virtualization?
Explain its types and benefits.
3–4 7-08-23

2. What is Google App Engine?


How is it used? Explain its
features and benefits. 5–6 21-08-23

3. Studying the features of the 7 28-08-23


GAE PaaS Model.

4. Introduction and application 8-9 11-09-23


of MVC.

5. Installing and Configuring 10-11 25-09-23


Required Platform for GAE.

6. Design and development of


Web applications using Struits
framework. 12-15 9-10-23

7. Design and Development of


Web applications using
Spring framework. 16 30-10-23

2
Practical 1: What is Virtualization? Explain its types and benefits.
Virtualization is the “creation of a virtual (rather than actual) version of something, such as a
server, a desktop, a storage device, an operating system or network resources.”
In other words, Virtualization is a technique, which allows to share a single physical instance of
a resource or an application among multiple customers and organizations. It does by assigning a
logical name to a physical storage and providing a pointer to that physical resources when
demanded.
The main usage of Virtualization Technology is to provide the applications with the standard
versions to their cloud users, suppose if the next version of that application is released, then cloud
provider has to provide the latest version to their cloud users and practically it is possible because
it is more expensive.
To overcome this problem we use basically virtualization technology, By using virtualization, all
servers and the software application that are required by other cloud providers are maintained by
the third-party people, and the cloud providers has to pay the money on monthly or annual basis.

Types of virtualizations:
➢ Application Virtualization.
➢ Network Virtualization.
➢ Desktop Virtualization.
➢ Storage Virtualization.
➢ Server Virtualization.
➢ Data Virtualization.

Application Virtualization
Application virtualization helps a user to have remote access to an application from a server. The
server stores all personal information and other characteristics of the application but can still run
on a local workstation through the Internet. An example of this would be a user who needs to run
two different versions of the same software. Technologies that use application virtualization are
hosted applications and packaged applications.

Network Virtualization
The ability to run multiple virtual networks with each having a separate control and data plan. It
co-exits together on top of one physical network. It can be managed by individual parties that are
potentially confidential to each other.
Network virtualization provides a facility to create and provision virtual networks- logical
switchers, routers, firewalls, load balancers, Virtual Private Networks (VPN), and workload
security within days or even weeks.

Desktop Virtualization
Desktop virtualization allows the users’ OS to be remotely stored on a server in the data centre.
It allows the user to access their desktop virtually, from any location by a different machine.
Users who want specific operation systems other than Windows servers will need to have a virtual

3
desktop. The main benefits of desktop virtualization are user mobility, portability, and easy
management of software installation, updates, and patches.

Storage Virtualization:
Storage virtualization is an array of servers that are managed by a virtual storage system. The
servers aren’t aware of exactly where their data is stored and instead function more like worker
bees in a hive. It makes managing storage from multiple sources be managed and utilized as a
single repository. storage virtualization software maintains smooth operations, consistent
performance, and a continuous suite of advanced functions despite changes, breaks down, and
differences in the underlying equipment.

Server Virtualization:
This is a kind of virtualization in which the masking of server resources takes place. Here, the
central server (physical server) is divided into multiple different virtual servers by changing the
identity number, and processors. So, each system can operate its operating systems in an isolated
manner. Where each sub-server knows the identity of the central server. It causes an increase in
performance and reduces the operating cost by the deployment of main server resources into a
sub-server resource. It’s beneficial in virtual migration, reducing energy consumption, reducing
infrastructural costs, etc.

Data Virtualization:
This is the kind of virtualization in which the data is collected from various sources and managed
at a single place without knowing more about the technical information like how data is collected,
stored & formatted then arranged that data logically so that its virtual view can be accessed by
its interested people and stakeholders, and users through the various cloud services remotely.
Many big giant companies are providing their services like Oracle, IBM, At scale, Cdata, etc.

Benefits of virtualization:
➢ More flexible and efficient allocation of resources.
➢ Enhance development productivity.
➢ It lowers the cost of IT infrastructure.
➢ Remote access and rapid scalability.
➢ High availability and disaster recovery.
➢ Pay peruse of the IT infrastructure on demand.
➢ Enables running multiple operating systems.

4
Practical 2: What is Google App Engine? How is it used? Explain its features
and benefits.
Google App Engine (GAE) is a platform-as-a-service product that provides web app developers
and enterprisers with access to Google’s scalable hosting and tier I internet service.

GAE requires that applications be written in Java or Python, store data in Google Bigtable and
use the Google query Language, Noncompliant applications require modification to use GAE.

GAE provides more infrastructure than other scalable hosting services, such as Amazon Elastic
Compute Cloud (EC2). GAE also eliminates some system administration and development tasks
to make writing scalable applications easier.

Google provides GAE free up to a certain amount of use for the following resources:
➢ Processor (CPU)
➢ Storage
➢ Application programming interface (API) calls
➢ Concurrent requests

Users exceeding the per-day or per-minute rates can pay for more of these resources.
How is GAE used?
GAE is a fully managed, serverless platform that is used to host, build and deploy web
applications. Users can create a GAE account, set up a software development kit and write
application source code. They can then use GAE to test and deploy the code in the cloud.
One way to use GAE is building scalable mobile application backends that adapt to workloads
as needed. Application testing is another way to use GAE. Users can route traffic to different
application versions to A/B test them and see which version performs better under various
workloads.

What are GAE’S key features?


Key features of GAE include the following:
➢ API selection. GAE has several built-in APIs, including the following five:
➢ Blob store for serving large data objects;
➢ GAE Cloud Storage for storing data objects;
➢ Page Speed Service for automatically speeding up webpage load times;
➢ URL, Fetch Service to issue HTTP requests and receive responses for efficiency and scaling;
and
➢ Memcached for a fully managed in-memory data store.

Managed Infrastructure
Google manages the back-end infrastructure for users. This approach makes GAE a serverless
platform and simplifies API management.

5
Several programming languages
GAE supports a number of languages, including GO. PHP, JAVA, PYTHON, NODEJS, .NET
and RUBY. It also supports custom runtimes.
Support for legacy runtimes. GAE supports legacy runtimes, which are versions of programming
languages no longer maintained. Examples include Python 2.7, Java 8 and Go 1.11.

Application diagnostics.
GAE lets users record data and run diagnostics on applications to gausge performance.

Security Features.
GAE enables users to define access policies with the GAE firewall and managed Secure sockets
Layer/ Transport Layer Security certificates for free.

Traffic splitting.
GAE lets users route requests to different application versions.

Versioning
Applications in Google App Engine function as a set of microservices that refer back to the main
source code. Every time code is deployed to a service with the corresponding GAE configuration
files, a version of that service is created.

Benefits of GAE

Ease of setup and use


GAE is fully managed, so users can write code without considering IT operations and back-end
infrastructure. The built-in APIs enable users to build different types of applications. Access to
application logs also facilitates debugging and monitoring in production.

Pay-per-use pricing
GAE’s billing scheme only charges users daily for the resources they use. Users can monitor their
resources usage and bills on a dashboard.

Scalability
Google App Engine automatically scales as workloads fluctuate, adding and removing
application instances or application resources as needed.

Security
GAE supports the ability to specify a range of acceptable Internet Protocol (IP) addresses. Users
can allowlist specific networks and services and blocklist specific IP addresses.

6
Practical 3: Studying the feature of GAE PaaS Model.

Google remains true to form, and as you might expect, makes a powerful statement with their
PaaS entry: GAE (Google App Engine). As one component of the Google Cloud Platform, GAE
is a robust and flexible platform with a variety of integration possibilities. GAE provides many
of the features and benefits you already expect from Google while also pushing forward the Cloud
Services industry in new and interesting ways.

Google App Engine is designed first and foremost as a scalable back end, both for your web apps,
as well as mobile apps and headless APIs. GAE accomplishes this in three ways.

First, like all PaaS products the infrastructure and software platform is fully managed for you by
Google in their data centers around the world. Your apps run on new cutting-edge servers stored
in high-tech operations centers that provide both physical and information security. Their
technicians, engineers, and architects are among the best in the business and keep things running
smoothly. Redundancy and Business Continuity is built into both the physical hardware of the
data center as well as the management platform that provides the GAE service.

Secondly, Google App Engine is able to dynamically scale up and down to meet the demands of
your user traffic regardless of variability or size. By monitoring the volume of incoming requests
as well as the service time and latency of your application’s responses. GAE can automatically
spin up new instances with your custom application to handle any additional load. This same
process in reverse allows GAE to reduce the size of your service platform to find the sweet spot
between responsiveness and cost-effectiveness. All of this is configurable by you with idle
instances to act as a floor when scaling down and quotas to limit your total spend and resource
utilization.

Lastly, GAE runs in the Google Cloud Platform which is a worldwide network of cloud services
that Google relies on to run its own products. Unlike other vendors who have built separate cloud
service centers specifically to resell to you, GCP uses the exact same servers, routers, and other
physical equipment for Google’s products as yours. When you deploy an application into GAE
you are relying on the same scaffolding that supports products such as Google Maps or Google
Mail. It’s entirely possible for your data to end up on the same disk as Google Search data. You’re
buying into the Google ecosystem in a way that makes you a partner with Google instead of a
customer. All of the speed and reliability that you expect from Google’s products are built into
your application as well.

GAE also integrates a number of additional features that you can take advantage of to ensure
your application remains highly available and responsive. Datastore is a schemaless object store
with scalable storage, an SQL-Like querying language, and an easy-to-use API built into the GAE
sdk. Memcache provides lightning quick in-memory caching that not only improves application
speed, but also can reduce costs by reducing the number of calls to outside services. Task queues
and scheduled tasks allow for traffic and communication management with simple API interfaces
to push and pull from message queues. These are just some of the features built into GAE and
there are plenty more, but GAE can also integrate tightly with other Google Cloud Platform
products such as Cloud SQL, BigQuery, and Compute Engine.

7
Practical 4: Introduction and application of MVC.
The Model-View-Controller (MVC) framework is an architectural/design pattern that separates
an application into three main logical components Model, View, and Controller. Each
architectural component is built to handle specific development aspects of an application. It
isolates the business logic and presentation layer from each other. It was traditionally used for
desktop graphical user interfaces (GUIs). Nowadays, MVC is one of the most frequently used
industry-standard web development frameworks to create scalable and extensible projects.

Following are the components of MVC-


Model
The Model component corresponds to all the data-related logic that the user works with. This can
represent either the data that is being transferred between the View and Controller components
or any other business logic-related data. It can add or retrieve data from the database. It responds
to the controller’s request because the controller can’t interact with the database by itself. The
model interacts with the database and gives the required data back to the controller.

View
The View component is used for all the UI logic of the application. It generates a user interface
for the user. Views are created by the data which is collected by the model component but these
data aren’t taken directly but through the controller. It only interacts with the controller.

Controller
The controller is the component that enables the interconnection between the views and the model
so it acts as an intermediary. The controller doesn’t have to worry about handling data logic, it
just tells the model what to do. It processes all the business logic and incoming requests,
manipulates data using the Model component, and interacts with the View to render the final
output.

8
Features of MVC:

➢ It provides a clear separation of business logic, Ul logic, and input logic.


➢ It offers full control over your HTML and URLs which makes it easy to design web
application architecture.
➢ It is a powerful URL-mapping component using which we can build applications that have
comprehensible and searchable URLs.
➢ It supports Test Driven Development (TDD).
➢ Easy and frictionless testability. Highly testable, extensible and pluggable framework
➢ To design a web application architecture using the MVC pattern, it offers full control over
your HTML as well as your URLs.
➢ Leverage existing features provided by ASP.NET, JSP, Django etc.
➢ Clear separation of logic: Model, View, Controller. Separation of application tasks viz.
business logic, UI logic, and input logic.
➢ URL Routing for SEO-friendly URLs. Powerful URL- mapping for comprehensible and
searchable URLs.

9
Practical 5: Installing and Configuring Required Platform for GAE.
Installing required SDKs
1. If you haven’t already installed Java SE 8 SDK, install the Java SE 8 Development Kit (JDK).
2. Install and initialize the latest version of the gcloud CLI.

Install and Initialize gcloud CLI


• Install the App Engine Java component:
• Authorize your user account:
• cloud auth application-default login

Configuring Maven in your development environment


• Download Maven 3.5 or later from the Maven Website.
• Install Maven 3.5 or later on your local machine.
• Creating a new App Engine project
• To create an App Engine App:
• Create a new directory.

Initialize the new project in the created directory:


mavenarchetype: generate -Dap engine-version=1.9.59 -Djava8=true DCloudSDK_Tooling=true
-Application-id=your-app-id Filter=com.google.app engine.
Archetypes:

a Set -Dappengine-version to the most recent version of the App Engine SDK for Java,
and application-id to the ID of your Google Cloud project.
b Set -Djava8=true to deploy the project in the Java 8 runtime.
c Set -DCloudSDK_Tooling=true to use gcloud CLI tooling.

3. When prompted to choose an archetype, choose the value 2 for the App Engine skeleton
archetype. This creates an empty project that contains the required directory structure and files.

4.When prompted for version, press ENTER to select the default most recent version.

5. When prompted to Define value for property 'groupId', supply the desired namespace for your
app; for example, com.mycompany.myapp.

6.When prompted to Define value for property 'artifactId', supply the project name; for example,
myapp.

7. When prompted to Define value for property 'version', accept the default value.

8. When prompted to Define value for property 'package', supply your preferred package name
(or accept the default). The generated Java files will have the package name you specify here.

10
9. When prompted to confirm your choices, accept the default value (Y).

10. Wait for the project to finish generating, then change directories to the new project directory,
for example myapp/.
11.Add the gcloud CLI-based plugin to your project's pom.xml file.
<build>
<plugins>
[...]
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.4.4</version>
<configuration>
<projectId>your-project-ID-goes-here</projectId>
<version>1</version>
</configuration>
</plugin>
[...]
</plugins>
</build>

12. Specify the target Google Cloud Platform project ID and the service and version in the plugin
configuration.

11
Practical 6: Design and development of Web applications using Struits
framework.
Create the directory structure:
The directory structure of struts 2 is same as servlet/JSP. Here, struts.xml file must be located in the
classes folder.

Create input page (index.jsp)


This jsp page creates a form using struts UI tags. To use the struts UI tags, you need to specify uri
/struts-tags. Here, we have used s:form to create a form, s:textfield to create a text field, s:submit to
create a submit button.

index.jsp
<%@ taglib uri="/struts-tags" prefix="s" %>
<s:form action="product">
<s:textfield name="id" label="Product Id"></s:textfield>
<s:textfield name="name" label="Product Name"></s:textfield>
<s:textfield name="price" label="Product Price"></s:textfield>
<s:submit value="save"></s:submit>
</s:form>
Provide the entry of Controller in (web.xml) file
In struts 2, StrutsPrepareAndExecuteFilter class works as the controller. As we know well, struts
2 uses filter for the controller. It is implicitly provided by the struts framework. web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<filter>
<filter-name>struts2</filter-name>

12
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Create the action class (Product.java)
This is simple bean class. In struts 2, action is POJO (Plain Old Java Object). It has one extra method
execute i.e. invoked by struts framework by default.

Product.java
package com.javatpoint; .
public class Product {
private int id;
private String name;
private float price;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
public String execute(){
return "success";

13
}
}
Map the request in (struts.xml) file and define the view components
It is the important file from where struts framework gets information about the action and decides
which result to be invoked. Here, we have used many elements such as struts, package, action
and result. struts element is the root elements of this file. It represents an application. package
element is the sub element of struts. It represents a module of the application. It generally extends
the struts-default package where many interceptors and result types are defined.

action element is the sub element of package. It represents an action to be invoked for the
incoming request. It has name, class and method attributes. If you don't specify name attribute
by default execute() method will be invoked for the specified action class.
result element is the sub element of action. It represents an view (result) that will be invoked.
Struts framework checks the string returned by the action class, if it returns success, result page
for the action is invoked whose name is success or has no name. It has name and type attributes.
Both are optional. If you don't specify the result name, by default success is assumed as the result
name. If you don't specify the type attribute, by default dispatcher is considered as the default
result type. We will learn about result types later.
struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="default" extends="struts-default">
<action name="product" class="com.javatpoint.Product">
<result name="success">welcome.jsp</result>
</action>
</package>
</struts>
Create view components (welcome.jsp)
It is the view component the displays information of the action. Here, we are using struts tags to get
the information.

The s:property tag returns the value for the given name, stored in the action object.

welcome.jsp
1. <%@ taglib uri="/struts-tags" prefix="s" %> 2.
3. Product Id:<s:property value="id"/><br/>
4. Product Name:<s:property value="name"/><br/>
5. Product Price:<s:property value="price"/><br/>

14
Load the jar files
To run this application, you need to have the struts 2 jar files. Here, we are providing all the necessary
jar files for struts 2. Download it and put these jar files in the lib folder of your project.

download the struts2 jar files

start server and deploy the project


Finally, start the server and deploy the project and access it. download this example

15
Practical 7: Design and Development of Web applications using Spring
framework.

Spring is a free, open-source framework for developing web applications in Java. It is a lightweight,
modular framework that provides a comprehensive set of tools and services for building web
applications.

To design and develop web applications using the Spring framework, you can follow these steps:

Install and set up the required tools and libraries, such as the Java Development Kit (JDK) and
Apache Maven.

Create a new Maven project for your web application and configure it to use the spring framework.

Define the model for your application, which represents the data and business logic. This can include
Java classes that represent your data entities and methods that perform operations on the data.

Define the view for your application, which represents the user interface. This can include HTML
templates and JSP files that define the layout and structure of the user interface.

Define the controller for your application, which coordinates the flow of data and interactions
between the model and the view. This can include Spring MVC controllers and configuration files
and user requests to specific actions in your applications.

Test and debug your application using the built-in tools and libraries provided by the spring
framework.

Deploy your application to a web server or cloud platform, such as Apache Tomcat or Google App
Engine.

16

You might also like