Beyond LAMP: SAMP… LGPJ… LAMJ…

 
By Rick Palkovic, July 2008  
Contents
 
What Is LAMP?
MySQL: the M in LAMP
Putting the S in AMP
AMP on OpenSolaris
Cool Stack: An Easy Route to SAMP
NetBeans IDE
Linux and Sun-Sponsored Developer Tools
Downloads
Conclusion
References
 

Someday in the distant future — like next year — your grandchild may ask you, "O Grandperson, what does LAMP mean?"

You'd be tempted to answer, "It's an open-source software stack, My Child. It stands for Linux, Apache, MySQL, and PHP (or maybe Perl or Python)."

To which your grandchild would reply, "Whoa! You're really old!"

What Is LAMP?

Fact is, it seems that every day there are more options to the components in the LAMP stack, leading to a flood of unpronounceable acronyms. As a result, developers refer to the LAMP stack even if they're using Ruby instead of PHP, PostgreSQL instead of MySQL, or OpenSolaris instead of Linux. Each element in the stack — operating system, web server, database server, and language — has many open-source alternatives.

And nothing says you can't substitute compatible fee-based software anywhere in the stack if you prefer — witness the many developers who develop on Windows systems but target Linux servers. Increasingly, the power to choose rests in the hands of the developer.

But let's concentrate on open-source software and have a look at the alternatives — choices available to a lean and mean developer working in the back room, cooking up the Next New Web Thing. The following table presents just some of these alternatives.

Linux
OpenSolaris
FreeBSD
NetBSD
OpenBSD
Darwin/MacOS X
( the MacOS X GUI layer
is not open source
)
 

Note that the table mixes native software with Java technologies — and purposely so. With the introduction of dynamic scripting languages designed for the Java Virtual Machine, the lines between developing for native and JVM server targets have begun to blur.

If you want to develop in a Java environment and incorporate Java libraries, you can use the Java Native Interface (JNI) to execute the dynamic language within a native scripting environment. For Ruby, you could use the JNI-based gem Ruby Java Bridge (RJB). A better approach might be to run your dynamic language on top of the JVM — language choices now include Jython, JRuby, Groovy, Scala, and more than thirty other languages in addition to Java itself.

Some of these languages were developed to address specific problem domains. If your programming problem is very specialized or you're simply curious (and ambitious), you can even write your own language using the API defined in the JSR 223 specification.

If you're going to be serving Java applications, you'll want to use a Java-compliant application server such as GlassFish — a good choice because it makes it easy to develop in the same environment in which you deploy your web application. Speaking of Java technology, note that Sun Java System Web Server has been omited from the list. Although the web server is not open source, it is free to download. It is the web server that Sun uses for SpecWEB 2005 benchmarks for new CMT-based systems, and remains the standard for high-end enterprise environments.

Whichever stack components you choose, you'll want them to play well together so that you spend more time solving your business problem and less time setting properties in configuration files. In fact, compatibility accounts for the popularity of the original Linux-Apache-MySQL-PHP combination. While not specifically designed to work together, open standards have enabled these components to be tuned to cooperate nicely in a web development environment.

MySQL: the M in LAMP

In spite of alternatives both open source and proprietary, the MySQL database server maintains its position of leadership in the enterprise-grade open-source database market. Its adaptability and ease of use is largely due to its architecture and ability to scale, making it suitable for both development and deployment. MySQL database server is included in many operating system releases targeted for web developers.

Putting the S in AMP

One brief article can't possibly do justice to the myriad combinations that are possible in a web development stack. The remainder of this article focuses on the SAMP option — the stack anchored by the Solaris (or OpenSolaris) operating system and the MySQL database server. Because the LAMP acronym is so ingrained, SAMP is sometimes identified by the phrase, "LAMP stack on Solaris."

None of the several flavors of BSD UNIX have caught on among developers the way Linux has. UNIX System V Release 4, however, has been a presence for years in enterprise installations in the form of Solaris, AIX, and HP-UX. With Sun's announcement in 2005, Solaris is the only SVR4-based OS to be released into open source. The move of Solaris, with its proven performance advantages, to open source is a seminal event in the evolution of operating systems.

You can download both Solaris and OpenSolaris for free. Solaris is best suited to experienced users launching mission-critical, long-term deployments, whereas OpenSolaris is best suited to developers who want the latest features.

The pedigree of OpenSolaris accounts for its advantages in scalability, reliability, performance, and observability. Built on the Solaris 10 code base, the OpenSolaris OS contains features not available in the latest Solaris update. In time, these features find their way into Solaris updates and milestone releases through the OpenSolaris and Solaris release model.

OpenSolaris provides an operating environment familiar to users of Linux-based operating environments. Other features, which it shares with its Solaris 10 sibling, include:

  • An easy-to-use graphical installation experience
     
  • Data integrity and ease of use with the 128-bit ZFS default root filesystem
     
  • Solaris Containers virtualization technology
     
  • Predictive self-healing, which automatically diagnoses, isolates, and recovers from many hardware and application faults
     
  • The DTrace dynamic tracing tool for program observability and performance tuning in deployed applications
     
  • Optimization for multicore x86 and SPARC systems

The OpenSolaris and Solaris datasheets have details on available features.

Of course, just because you develop with the SAMP stack doesn't mean you can't target your application to a server running under a different operating system such as Linux. Finally, note that you can install OpenSolaris in VirtualBox and run it as a guest operating system on an x86 machine. That way, you can enjoy the benefits of developing in OpenSolaris without entirely leaving the comfort of your host operating system.

AMP on OpenSolaris

OpenSolaris users can download the tools needed for web development in a convenient cluster package located in the pkg.opensolaris.org repository. The amp-dev package is a superset of all individual AMP packages in the repository.

The following table presents an overview of the components in the amp-dev package.

NetBeans IDE
Open-source integrated development environment
PHP
PHP server
PHP server documentation
PHP server man pages
PHP5 module for PostgreSQL
PHP5 module for MySQL
Python
Python interpreter, libraries and utilities
Twisted, an event-based framework for Internet applications
Apache
Apache Web Server
Tomcat connector plug-in for Apache Web Server
Mod security for Apache Web Server
Apache Web Server documentation
PHP5 module for Apache Web Server
FastCGI plug-in for Apache Web Server
Dtrace plug-in for Apache Web Server
Tomcat
Application
MySQL
MySQL database management system (user component)
MySQL database management system (Base)
Squid
Squid web proxy cache
memcached
Distributed memory caching system
Subversion
Version control system
CVS
Version control system
WebStack Tools and UI
Adds desktop features to operate the Solaris, Apache, MySQL, PHP stack
 

A similar package, named ruby-dev, is available in the OpenSolaris repository for Ruby developers.

Cool Stack: An Easy Route to SAMP

In conjunction with the OpenSolaris open-source effort, Sun has introduced the Web Stack project. The goal of the project is to address the OpenSolaris community needs for web tier technologies. As a first step, Sun has collected and tuned a set of the most common open-source applications for use on Solaris OS. The collection is called Cool Stack.

The Cool Stack packages for Solaris include the the following Cool Tools:

  • A runtime that contains core libraries.
     
  • Bundled versions of Apache HTTP Server, PHP, and MySQL, pre-configured to work together. This version of MySQL is 32-bit, with client-side support to work with PHP.
     
  • A separate 64-bit version of MySQL for users who need larger caches for better performance on large databases.
     
  • Perl version 5, including several Perl extensions used by popular applications.
     
  • A bundle of libraries required by various PHP extensions.
     
  • memcached, the distributed object cache system.
     
  • Python, Ruby, Rubygems, and Rails.
     
  • The Squid web proxy cache.
     
  • Apache Tomcat server: The same version distributed by the Apache Software Foundation.
     
  • lighttpd, the light-weight HTTP server.
NetBeans IDE

Because time to market is so important in web development, choice of tools and integrated development environment (IDE) can be as important as the implementing technologies themselves. The two free, open-source, cross-platform IDEs with the largest feature sets are arguably NetBeans and Eclipse, although other IDEs such as Aptana have their adherents. Still, some prefer text-based editors like vim or TextMate — especially for dynamically typed languages like Ruby.

The NetBeans IDE is a good choice for SAMP development because, in addition to running on the Solaris OS, it runs on Windows, Linux, and Mac OS X. It is modular, with a plug-in architecture. It supports Ruby, JavaScript, PHP, Java in its several guises, JavaFX, and several other languages and frameworks. It accepts the DTrace GUI plug-in, a graphical user interface for running DTrace scripts.

It is both an open-source IDE and an application platform that can be used as a generic framework to build any kind of application. The netbeans.org web site lists its many features.

Version 6.1 of the NetBeans IDE comes bundled and set up with GlassFish and MySQL. Choose your development language, and your SAMP stack is complete.

Linux and Sun-Sponsored Developer Tools
 

Downloads

  • Cool Stack – Commonly used open-source applications optimized for Solaris
  • OpenSolaris – Free, open-source Solaris OS
  • Sun Studio Express – High-performance, optimizing C, C++, and Fortran compilers and tools for OpenSolaris
  • GlassFish – Open-source application server based on Java EE 5 technology
  • NetBeans – Free, open-source IDE
  • VirtualBox – Free x86 virtualization software package
  • OpenOffice.org – Free multiplatform, multilingual office suite

If you choose to develop under the Linux OS, you can still use many Sun-sponsored open-source tools. In fact, these tools are increasingly finding their way into Linux distributions such as Ubuntu.

Key open-source offerings for Linux users are the following:

  • NetBeans IDE – Provides tools for Java technology, C/C++, Ruby/JRuby, JavaScript, and PHP.
     
  • GlassFish Application Server – Implements the newest features in the Java EE 5 platform.
     
  • MySQL Database Server – The world's most popular enterprise-class open-source relational database management system.
     
  • JavaDB Database Server – A Java relational database management system based on Apache Derby.
     
  • OpenJDK Java Development Kit – A Java development kit based entirely on open-source code.
     
  • VirtualBox Virtualization Software – A software package that can be installed on popular x86 operating systems and that serves as a hypervisor for additional guest operating systems, each running in its own virtual environment.
     
  • OpenOffice.org Office Productivity Software – The leading international open-source office suite that runs on popular platforms and provides a high degree of compatibility with Microsoft Office.
     
  • Sun Studio – Programming tools that provide modern C, C++, and Fortran compilers that take advantage of multicore hardware. The compilers produce auto-parallelized code, and included tools provide debugging, thread analysis, and profiling as well as MPI support through Sun HPC ClusterTools.
Conclusion

Today's developer has many open-source choices for filling out the web development software stack commonly called LAMP. The combination of Solaris/OpenSolaris OS, Cool Stack tools (including MySQL), and the NetBeans IDE, let you develop productively in your language of choice with technologies that can scale to large deployments.

Users committed to other operating systems, such as the Linux OS, can also use Sun-sponsored open-source tools in their development stacks.

References
Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments: