CloudComputing - Practical File
CloudComputing - Practical File
CloudComputing - Practical File
PRACTICAL FILE
CLOUD COMPUTING
LAB
(CS-711)
Creating an application in
3 salesforce.com using Apex 6-7
programming language.
Implementation of SOAP web
4 services in C#/JAVA Application. 8-11
PRACTICAL: 1
Cloud computing is a general term for the delivery of hosted services over the internet.Cloud
computing enables companies to consume a compute resource, such as a virtual machine (VM),
storage or an application, as a utility -- just like electricity -- rather than having to build and
maintain computing infrastructures in house.
Cloud computing characteristics and benefits
Cloud computing boasts several attractive benefits for businesses and end users. Four of the main
benefits of cloud computing are:
Self-service provisioning: End users can spin up compute resources for almost any
type of workload on demand. This eliminates the traditional need for IT administrators to
provision and manage compute resources.
Elasticity: Companies can scale up as computing needs increase and scale down again
as demands decrease. This eliminates the need for massive investments in local
infrastructure, which may or may not remain active.
Pay per user: Compute resources are measured at a granular level, enabling users to
pay only for the resources and workloads they use.
Migration flexibility: Organizations can move certain workloads to or from the
cloud -- or to different cloud platforms -- as desired or automatically for better cost
savings or to use new services as they emerge.
Cloud computing deployment models:(Public, Private or Hybrid)
Public Cloud: Public cloud computing relies on shared resources and services provided by a
third-party cloud service provider, accessible over the internet by multiple organizations.
Private Cloud: Private cloud computing involves dedicated resources and services provisioned
within a single organization's infrastructure for its exclusive use, ensuring greater control and
security.
Hybrid Cloud: Hybrid cloud computing combines public and private cloud deployments,
allowing data and applications to be shared between them while maintaining flexibility and
scalability.
Types of cloud computing services
It has been divided into three broad service categories: infrastructure as a service
(IaaS), platform as a service (PaaS) and software as a service (SaaS).
PRACTICAL: 2
Tell Me More
The app you just created is very simple -- or is it? Look closely around the screen to see all of the
functionality available by default to your Warehouse app.
Every object in Force.com automatically has an attached "feed," called Chatter, that lets
authorized app users socialize about and collaborate on the object.
Using Chatter, users can post updates in an object's feed, comment on posts, and follow
(subscribe to) the feed to get pushed updates when they happen. For example, on a
Merchandise record, one user might post a question about the record, to which followers
and other users can comment in reply.
Every DE org has a secure Chat window that lets users interact with one another. You can
also manage activities related to a record from the Open Activities and Activity History
related lists..
Every app has full-text search functionality for all text fields of an object and
Chatter feeds.
Every DE org has a recycle bin that you can use to view and restore deleted records.
Every record in Force.com has an "owner," which serves as the basis for a powerful
security system that supports ownership-based record sharing scenarios.
trigger blockDuplicates_tgr on Lead bulk(before insert, before update) {
/*
* begin by building a map which stores the (unique) list of leads
* being inserted/updated, using email address as the key.
*/
Map<String, Lead> leadMap = new Map<String, Lead>(); for
(Lead lead : System.Trigger.new) {
if (lead.Email != null) { // skip null emails
/* for inserts OR
* updates where the email address is changing
* check to see if the email is a duplicate of another in
* this batch, if unique, add this lead to the leadMap
*/
if ( System.Trigger.isInsert ||
(System.Trigger.isUpdate &&
lead.Email != System.Trigger.oldMap.get(lead.Id).Email))
{
if (leadMap.containsKey(lead.Email)) {
lead.Email.addError('Another new lead has the same email address.');
} else {
leadMap.put(lead.Email, lead);
}
}
}
}
PRACTICAL: 3
Apex Code is designed explicitly for expressing business logic and manipulating data, rather than
generically supporting other programming tasks such as user interfaces and interaction. Apex
Code is therefore conceptually closer to the stored procedure languages common in traditional
database environments, such as PL/SQL and Transact- SQL.Control structures are also Java-like,
with for/while loops and iterators borrowing that syntax directly.
PRACTICAL: 4
[WebService(Namespace="http://tempuri.org/",
Description="A Simple Web Calculator Service",
Name="CalculatorWebService")]
The Description attribute gives external clients a brief description of the service; the Name
attribute lets external clients refer to the service as CalculatorWebService rather than Service.
Installing the Web Service in IIS
This project uses IIS Server 7.0 running on a Windows 7 PC.
Activate IIS server by:
Start Menu / typing IIS in the search bar / Internet Information Services (IIS) Manager
or by: Control Panel / Administrative Tools / Internet Information Services (IIS) Manager
If you couldn’t find IIS, then probably it’s not installed, so consult Appendix A to know how
you can activate this program under Windows 7.
Expand the tree Sites, then right click on Default Web Site, and choose Add
Virtual Directory.
Enter WebService in the Alias field, and C:\Project7\Server in the Physical path
field.
Click on the WebService folder and then switch IIS to Content View in order to see
the Service.asmx and the web.config files.
Since we’ve manually created the Virtual Directory WebService without the help of Visual
Studio testing mode, you should right click the WebService folder and choose Convert to
Application followed by clicking OK.
Now open your browser and goto http://localhost/WebService/Service.asmx.
Creating the ASP.NET Web Client
Launch Visual Studio, and then go to File / New / Web Site...
Choose ASP.NET Web Site as the template and name your project Client.
Edit your Default.aspx.cs source to add the method GetResult that takes as an input two
number strings and an integer function which corresponds to the four basic calculator
operations we need.
private string GetResult(string firstNumber, string secondNumber, int function)
{
ServiceReference.CalculatorWebServiceSoapClient client = new
ServiceReference.CalculatorWebServiceSoapClient();
int a, b;
string result = null;
erra.Text = "";
errb.Text = "";
if (!int.TryParse(firstNumber, out a))
{
erra.Text = "Must be a valid 32-bit integer!";
return "";
}
if (!int.TryParse(secondNumber, out b))
{
errb.Text = "Must be a valid 32-bit integer!";
return "";
}
try
{
switch (function)
{
case 0:
result = firstNumber + " + " + secondNumber + " = " + client.Add(a, b);
break;
case 1:
result = firstNumber + " - " + secondNumber + " = "+ client.Subtract(a, b);
break;
case 2:
result = firstNumber + " * " + secondNumber + " = " + client.Multiply(a, b);
break;
case 3:
result = firstNumber + " / " +secondNumber + " = " + client.Division(a, b);
break;
}
}
catch (Exception e)
{
LabelResult.ForeColor = System.Drawing.Color.Red;
result = "Cannot Divide by Zero!";
}
return result;
}
ServiceReference.CalculatorWebServiceSoapClient client =
new ServiceReference.CalculatorWebServiceSoapClient();
which allows the client object to access the web service methods. ServiceReference is the
namespace of the web service you chose earlier. CalculatorWebServiceSoapClient establishes the
SOAP connection with client (i.e. sends requests and receives responses in the form of SOAP
XML messages between the proxy server and the proxy client).
Finally, add the Submit Button event handler with the following code to access the GetResult
method you created earlier.
protected void btnSubmit_Click(object sender, EventArgs e)
{
LabelResult.ForeColor = System.Drawing.Color.Black;
LabelResult.Text = GetResult(TextBoxFirstNumber.Text,
TextBoxSecondNumber.Text, DropDownList.SelectedIndex);
}
PRACTICAL: 5
AIM: Implementation of Para-Virtualization using VM Ware’s workstation/oracle’s
virtual box and Guest O.S.
PRACTICAL:
6
7. HDFS Setup:
Format the HDFS filesystem for the first time by running:
` hdfs namenode -format `
8. Start Hadoop Services:
Start the Hadoop services using the following commands:
` start-dfs.sh # Start HDFS
start-yarn.sh # Start YARN (MapReduce) `
9. Access Hadoop Web Interfaces:
You can access the Hadoop web interfaces by opening a web browser and
navigating to `http://localhost:9870` for the HDFS NameNode and
`http://localhost:8088` for the YARN ResourceManager.
10. Verify Installation:
You can run some sample Hadoop jobs or use Hadoop command-line tools to
ensure your installation is working correctly.
PRACTICAL:7
job.setJarByClass(WordCountDriver.class);
job.setMapperClass(WordCountMapper.class);
job.setCombinerClass(WordCountReducer.class);
job.setReducerClass(WordCountReducer.class);
job.setOutputKeyClass(Text.class); job.setOutputValueClass(LongWritable.class);
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
1. Compile the code:
Compile the Java code and create a JAR file using your Java development
environment or the `javac` command.
2. Run the Word Count application:
To run the Word Count application, use the following Hadoop command:
`hadoop jar WordCount.jar WordCountDriver input.txt output`
PRACTICAL: 8
Facebook Ads are far cheaper than the legacy advertising solutions (newspaper, tv, etc.), but
also left behind its online competitors (Adwords and LinkedIn).
The objective of this case study or experiment was to show that even if you start with a
minimal budget, Facebook Ads can still prove beneficial.
PRACTICAL: 9
AWS is a cloud computing platform provided by Amazon that offers a wide range of services,
including computing power, storage, databases, machine learning, analytics, and more. AWS has
played a pivotal role in transforming the way businesses operate and has become a key player in
the cloud computing industry.
Results:
1. Market Dominance: AWS has become the dominant player in the cloud computing
market, with a large customer base that includes startups, enterprises, and public sector
organizations.
2. Innovation: AWS has continuously innovated, introducing a wide range of services,
including machine learning, IoT, serverless computing, and more.
3. Cost-Efficiency: AWS's pay-as-you-go pricing model has enabled organizations to
reduce capital expenditures and optimize their IT spending.
4. Economic Growth: AWS has contributed to economic growth by enabling startups to
launch quickly and by providing a scalable, cost-effective platform for businesses of all
sizes.
5. Global Impact: AWS has played a significant role in supporting critical workloads,
such as healthcare research, disaster recovery, and education, especially during the
COVID-19 pandemic.