A comparative study of server-side technologies

beckonhissingInternet και Εφαρμογές Web

10 Νοε 2013 (πριν από 4 χρόνια και 3 μέρες)

76 εμφανίσεις

A comparative study of server
-
side technologies
1





A comparative study of server
-
side technologies


Rovil Andrade









Programming for WWW

Prof. Mark Reynolds

January 25, 2009

A comparative study of server
-
side technologies
2


Abstract

Web developers around the world find it very easy to develop and design web pages using basic
HTML and CSS. HTML, th
ough very powerful does not provide dynamic information to users.
Using HTML would be sufficient in scenarios where the data is small and static. However, in
most cases the data is dynamic and huge which cannot be stored on the client side. This gave rise
to Server side scripting where the scripts on a HTML page that was requested by a client is first
executed at the server side and then sen
t to the client’s browser. In

this paper I will make a
comparative study between PERL, ASP, PHP and ColdFusion which
are few of the vast pool of
server side scripting languages available today. I shall base the comparison on factors like
performance, cost, ease of use and type of support available for each of these languages.


Introduction

Server

Side scripting is
basica
lly a

web server technology
by which we can generate HTML
pages by running
the

code

on the server unlike client side scripting where the scripts are run on
the client’s
browser. Server

side scripting has great advantages over client side
scripting
. It can
sniff what browser is being used at the client side and display pages accordingly in order to meet
the browser specifications. All this take place without the client knowing about it. Since all the
scripts are being run on the server the client browser nee
d not support scripting at all.

Apart from
dynamically changing content on a web page, server side scripting can also respond to user
queries
, obtain results from a database and most importantly provide security since the server
A comparative study of server
-
side technologies
3


code cannot

be viewed on th
e client side
.

These languages offer almost the same set of features
but with a different approach and syntax.


PERL

Introduction

Perl is a cross platform, interpreted dynamic programming language. Its first version was
released on December 18
th

1987 by L
arry Wall. It was developed in order to manipulate text and
as an interpreter on UNIX, not as a web development language. It is an open source project
which provided good reusable software design for its time. However, during the course of time it
has deve
loped to be a very popular server side web programming language that can be used to
produce dynamic and powerful web content. Perl uses the Common Gateway Interface, a
protocol popularly known as CGI to create dynamic content by sending request from the br
owser
to the web server.

Performance

Perl has a li
mited support for pre compiling
,

it has to compile the source code each time it runs
thus making large Perl programs very slow as compared to the same program written in other
languages. A Perl program can
be said to have 4 stages, namely, compiling, code generation,
parse tree reconstruction and execution of the program. Of these stages, code generation and
parse tree reconstruction are optional. If we use a code generator, it converts the Perl program to
C

or bytecodes.Since the code has been converted it has to undergo the parse tree construction
again. This reconstructed tree can then be sent to be interpreter, who executes it to provide the
A comparative study of server
-
side technologies
4


results. The compiled Perl program can also be directly sent to
the interpreter skipping the
middle two stages. If the path, where the compiled code is directly sent to the interpreter is
chosen, there will be an overhead hindering the performance since the interpreter handles the
memory management and data typing. In
spite of these drawbacks, a Perl program can be
optimized to work with higher performance, but this comes at a price of having the knowledge of
the working of the Perl interpreter. There are many tools like mod_perl, ISAPI, ActivePerl that
help to improve
the performance of a Perl program.

Cost


Perl is an open source product, thus its source code and documentation is free to download and
use. Perl
is released under the
Artistic

license and GNU General public License. Thus the author
of the Perl program
is also the owner. Mostly all the web hosting providers support PERL, hence
we do not have an additional cost setting up a server.

Ease of Use

Perl is a procedural language
a
nd

it has been written in C. Perl went on to grow by incorporating
features fr
om different programming like C, shell programming, Lisp, awk and sed.With the
integration of the cgi.pm module it has eased programming for generating HTML outputs. Since
it was created on a UNIX platform, it performs exceptionally well on it than Window
s or any
other platform. However, with use of Active Perl or Cygwin it is possible to use Perl with
Windows. Now
-
a
-
days almost all machines provide support for Perl. Since it can handle large
amounts of data, it is widely used in fields of bioinformatics a
nd finance.


A comparative study of server
-
side technologies
5


Support

Perl being developed over decade ago has very few bugs and lot of online help available. Perl
also has a centralized source called Comprehensive Perl Archive Network (CPAN) which is a
huge repository for sample scripts and modules. Sinc
e it is not a commercial product, we cannot
be assured a dedicated support, but have to rely on the wide developer network for solutions.

ASP

Introduction

Active Server Pages is a framework for the web applications developed by the Microsoft
Corporation in

December, 1996. ASP is not a language but a platform on which programming
languages like VBScript and JavaScript can be written in order to provide content for the web.
Of the languages Asp supports, VBScript is the most popular and widely used. ASP is ve
ry
powerful web development tool for the server side.ASP applications run within the Internet
Information Services (IIS). ASP follows an Object model having the following five standard
objects

1. Request: This is used to get input from the users. For examp
le, the data entered in the forms,
Query strings to get text from the user.

2. Response: The Response object is the counter part of Request, which sends the information to
the user.

A comparative study of server
-
side technologies
6


3. Server: The server object helps us to set the time limit for when the s
erver script can stop
processing. It also makes use of methods that applies HTML and URL Encoding to a specified
string.

4. Session: The session object is used to maintain the session state of a particular user to help
provide data based on the user. The s
ession state is maintained throughout all the pages until the
user logs out.

5. Application: The Application object is to bind all the ASP files of an application together. This
object is alive throughout the application lifetime.

Performance

ASP is slower

to PHP as ASP has been developed on COM technology which has an overhead
for the server. The COM technology helps the different softwares to take advantage of services
on a Windows machine and communicate with each other.

Cost

ASP has implemented on an II
S which is a Microsoft Server used to run internet based services
like HTTP,FTP, SMTP etc. ASP applications prove to be a costly deal as the technology is not
free and needs some components to be added to get some additional features, which also come at
a
cost. ASP being a Microsoft product prefers to be connected to Microsoft SQL Server. It is not
advisable to use ASP where cost is a factor since it would take a lot of investment for the initial
setup.


A comparative study of server
-
side technologies
7


Ease of use

ASP can be written with a wide variety of

languages.Vbscript and JavaScript come with the ASP
product. One can install language specific engines to ASP to work with a language of their
choice as long as the language supports ActiveX. PerlScript developed by ActiveState can be
used as a scripting
language in asp for programmers comfortable with Perl. It is not a difficult
platform to learn for non
-
programmers. However for programmers who are comfortable with C
and C++ find Visual basic annoying.ASP can be easily be implemented with XML and COM.
The
y are meant to be run on Windows machine e.g. Windows Server 2000, but can also work on
Linux machines with ASP
-
Apache installed on them. This allows ASP to be implemented on an
Apache server that allows us to write ASP in Perl code only.

Support


Microsof
t provides excellent
support for ASP. It

is not free
, but you can be rest assured that the
issue will be taken care of. MSDN is a forum for developers where discussions, tutorials and
help can be found on all the Microsoft Products.

ASP now is on

the .NET Framework and it is called ASP.NET. It is an entirely different
implementation of ASP. The .NET framework has a number of predefined classes and functions
to the disposal of ASP. ASP.NET code can be written in VB.NET or C#, which is an object
-
ori
ented programming language similar to Java and C++. ASP.NET supports much more
languages like J#, Chrome, Delphi.NET as compared to ASP. The applications built on
ASP.NET run faster than those on ASP as they use compiled code. ASP.NET can we written on
A comparative study of server
-
side technologies
8


an
IDE called Visual Studio, which makes ASP programming lot more easier as most of the code
is already written.

PHP

Introduction

PHP is a cross
-
platform, server side scripting language that is used to produce dynamic web
pages. Since its inception PHP has be
en widely accepted and has been the favorite scripting
language of every web developer. PHP has been developed with web development as the main
focus, thus it can be embedded into HTML code. PHP can work with many of the databases like
MySQL, Informix, Or
acle, Sybase, Postgre SQL etc. with no hassles unlike ASP which favors
Microsoft SQL Server being from the same family. After PHP hit the web development world,
Perl has been sidelined because PHP offers everything what Perl used to and does it more
effici
ently since it is integrated with the Web server unlike Perl which runs CGI program to
handle each request.PHP parses the file and manipulates the code written within <?php ?> tags
and gives the output in HTML.

PHP
has made an attempt to support
o
bject ori
ented programming, but has not been able to
implement it the way PHP programmers would have liked it to be. PHP has no support for
namespaces yet, thus two objects can not have the same name in PHP. A particular task can be
approached through a lot of ways

in PHP. PHP i
s not a strongly typed
language

and therefore

it
is not necessary to define a variable before we use it

w
hich
makes debugging troublesome.



A comparative study of server
-
side technologies
9


Performance

The execution time of PHP is increased because the source code is compiled at runtime as most
of

the code written is kept in human readable form. The speed can be optimized by using PHP
compilers, code optimizers and PHP accelerators. PHP accelerators allow caching of the
compiled code in memory, thus saving time during execution to compile the code
each time.
There are many free accelerators like Alternative PHP cache (APC), ionCube PHP accelerator
and others available to achieve this goal.

Cost


PHP is an open source web development language available at http://www.php.net/ that can be
used and inst
alled on UNIX or windows systems with no hassles at all.

Ease of Use

The syntax is similar to C and Perl making life easier for programmers.PHP has a large reservoir
of functions that can be referenced. PHP can be used on almost all servers and all kinds o
f
operating systems, thus giving versatility as compared to other server side scripting languages. It
is mainly used with Apache Server and MySQL as the database, which are free to use as well
which makes even more useful as there is absolutely no cost con
straints involved. PHP uses a
different syntax to connect with different databases unlike ASP and Java that use Ado and JDBC
respectively.



A comparative study of server
-
side technologies
10


Support

PHP has a large developer community that is very active. There are various user groups,
newsgroups, sample
codes and online documentation and books easily available that help
providing solutions.

ColdFusion

Introduction

ColdFusion was developed by

the

Allaire brothers and was released in July 1995 by Allaire
which was later on bought by Macromedia. It is now a prod
uct of Adobe. ColdFusion is a server
side programming language used to develop dynamic web pages. It has its own language called
ColdFusion Markup Language (CFML). CFML is tag
-
based, just like HTML. Though
ColdFusion has made a sincere effort in trying to
incorporate Object oriented features, it still
lacks behind considerably to provide wholesome features of OOP. It being a commercial product
provides lots of additional features like server clustering (both for the hardware and software),
simplified databa
se connectivity to all major database vendors, offers SMS and instant
messaging services and gives graphical results based on the data present on the database.
ColdFusion is a rapid development tool, giving you results by writing less code and very a short

span of time.

Performance

ColdFusion can be really slow at times because it runs on the Java framework. But in exchange
for the speed we get to call the underlying Java functions and J2EE libraries. Like JSP and ASP,
ColdFusion caches the compiled bytecod
e to be used later
.

A comparative study of server
-
side technologies
11


Cost

ColdFusion being a commercial platform does not come for free. This is the primary reason that
resulted in its slow growth.

The source code

Ease of Use

ColdFusion is tag based, hence making it very easy for non programmers to learn

as he has to be
acquainted with only a few tags to get him started with server side web development. The two
basic tags used in ColdFusion are the <CFQUERY> tag and the <CFOUTPUT> tag. The
<CFQUERY> can be used to pass SQL queries to retrieve data from a
data source lying on the
server and also get information about the query being passed. The <CFOUTPUT> tag is used to
display the results from a query or the value of a variable. ColdFusion allows users to extend the
existing tags by writing custom tags to
perform specialized functions. However, on the flip side
the programmers are not so comfortable with the transition from traditional C and C++
programming to tag based programming. ColdFusion came out with a solution to help the
programmers feel comfortab
le. They introduced JavaScript like language called CFScript which
would be easier to work
with. ColdFusion

can be used with Macromedia Flex to generate rich
internet applications. ColdFusion also has functionalities of ActionScript.

Support

Like all commer
cial products, ColdFusion too has a dedicated support for developers. Since it is
not an open source project the developer community is not so vast as compared to
t
hat

of PHP,
Perl and other free
programming languages
.


A comparative study of server
-
side technologies
12


Conclusion

With so many s
erver side scripting language to choose from, it all comes down to how
comfortable one is
with

a particular

programming

language, cost constraints of the application
being developed

and the

unique

features
p
rovided by a language

that

is not
available with others
an
d

which

suit
your

need. The server side scripting l
anguages available in the
market

offer
almost the same basic functionalities

but have
different

methodologies to
achieve

them
. Some of
them provide additional modules that may be of great use for a particular application and may be
i
rrelevant

for the other. Hence, one must study the
application
being developed with an insight
for future improvements in the application in terms of size and performance. With this in hand,
one can make a reasonable choice of

a

server side scripting language

to choose from to mee
t

his
need
s
in the

best suitable manner.









A comparative study of server
-
side technologies
13


References

Beasley, C. (2001, January 2).
Cold Fusion Tutorial: Part I
. Retrieved January 25, 2009, from Site point
Web site: http://www.sitepoint.com/
article/
cold
-
fusion
-
tutorial/

Cluts, N. W. (n.d.).
An ASP You Can Grasp: The ABCs of Active Server Pages
. Retrieved January 22, 2009,
from http://msdn.microsoft.com/
en
-
us/
library/
ms972317.aspx

GBdirect. (n.d.).
Active Web Sites and Comparison of Scripting Languages
. Retrieved January 6, 2009,
from http:
//training.gbdirect.co.uk/
courses/
php/
comparison_php_versus_perl_vs_asp_jsp_vs_vbscript_web_scripting.html

PHP: Supporting the New Paradigm of Situational and Composite Web Applications. (n.d.). In
International Conference on Management of Data archive

Proceedings of the 2006 ACM
SIGMOD international conference on Management of data
. Retrieved January 7, 2009, from
http://delivery.acm.org.ezproxy.rit.edu/
10.1145/
1150000/
1142553/
p707
-
gutmans.pdf?key1=1142553&key2=8191252321&coll=portal&dl=ACM&CFID=18
349891&CFTOK
EN=43255768

Pires, H. (2005, December 12).
ASP vs. PHP
. Retrieved January 10, 2009, from
http://www.webpronews.com/
expertarticles/
2005/
12/
22/
asp
-
vs
-
php

Prayaga, L. (2005). Building dynamic web applications with ASP.Net and ColdFusion MX 7.
0: a
comparative approach.
Proceedings of the 6th conference on Information technology education
,
121
-
124. Retrieved January/
February 19, 2009, from http://portal.acm.org.ezproxy.rit.edu/
citation.cfm?id=1095714.1095743&coll=portal&dl=ACM&CFID=19086947&CF
TOKEN=62218720

A comparative study of server
-
side technologies
14


Sitepoint. (n.d.).
Which Server
-
Side Language Is Right For You?

Retrieved January 6, 2009, from
http://www.sitepoint.com/
article/
server
-
side
-
language
-
right/

Smith, M. (n.d.).
What is ColdFusion?

Retrieved January 23, 2009, from Fusion Auth
ority Web site:
http://www.fusionauthority.com/
cfintro.cfm

W3schools. (n.d.).
Server
-
side Scripting Primer
. Retrieved January 2, 2009, from
http://www.w3schools.com/
web/
web_scripting.asp

Wall, L., Christiansen, T., & Orwant, J. (2000, July). Compiling.
In
Programming Perl, 3rd Edition
. O’Reilly.
Retrieved January 21, 2009, from http://oreilly.com/
catalog/
pperl3/
chapter/
ch18.html

Wikipedia. (n.d.).
Perl
. Retrieved January 6, 2009, from http://en.wikipedia.org/
wiki/
Perl

Wikipedia. (n.d.).
Server
-
side

scripting
. Retrieved January 2, 2009, from http://en.wikipedia.org/
wiki/
Server
-
side_scripting