Header image

Symfony Finland
Random things on PHP, Symfony and web development

State of the LAMP in 2015

The LAMP stack (Linux, Apache, MySQL, PHP) has been the mainstay of millions for web developers for well over a decade. But how is it doing and where is it going? Is calling it LAMP even valid any longer? Let's examine this by going through each of the letters in the acronym.

L is for Linux

Linux remains the most common production Operating System for LAMP. BSD based systems are used for development quite a bit (thanks to the popularity of OS X), but for production use using FreeBSD or other variants remains a curiosity. Microsoft Windows is also used for development and hosting, but remains a second class citizen with exceptions such as missing support symlinks.

Redhat and Debian based Linux distributions remain popular in numerous flavours. Developers use Archlinux and other more exotic options for development, but they're not common for production environments. Shared web hotels are down in popularity.

For hosting environments virtual servers or cloud services such as Amazon Web Services (AWS) are the norm for most mainstream tasks. For development the use of virtual machines for complete environments using CoreOS on Vagrant (or the replacement, Otto) is picking up pace. For deployment the future is likely holds containers such as Docker.

A is for Apache

Apache is still the most popular HTTP server powering the web. Paired with PHP-FPM instead of a module (mod_php) it offers good performance for PHP hosting and remains a valid choice. Nginx has been catching up as an alternative server and has become the de-facto choice for many developers and sysadmins.

Nginx is a versatile and performant server that can be used for a number of things and it is increasingly used for multiple different roles:

  • SSL/TLS Termination
  • Reverse Proxy
  • Web Application serving

Speciality HTTP solutions such as Varnish reverse proxy and other SSL offloaders remain popular, but for many use cases a single installation of Nginx is capable of handling numerous roles. The HTTP/2 protocol is another thing that is fast becoming a staple as both Apache and Nginx support it in their latest incarnations.

Niches for HTTP remain, such as using Varnish HTTP/2 with SSL/TLS offloading on H2O. But most sites do just fine on a straight forward Apache or Nginx, configured with a supporting CDN for media delivery for high traffic.

M is of MySQL

MySQL remains a very used data storage among applications built on LAMP. MySQL itself has lost some developer mindshare after the acquisitions by Sun and later Oracle, but it is likely still the #1 option. In addition to MySQL, there are drop-in replacement options such as MariaDB and Percona.

Other relational databases such as Oracle, PostgreSQL and Microsoft SQL Server are also supported, but not such scale (with PHP) as MySQL compatible ones. It's also worth noting that MySQL has continued evolving with features such as JSON data storage.

Many popular applications such as CMS like still widely employ MySQL as their primary database solution, but these are more and more supported by other technologies. Solr and Elasticsearch are popular Java-based search engine daemons that are populated from a relational database to provide data searches.

Document databases such as CouchDB and MongoDB are increasingly used for storing data in adhoc applications where speed and flexibility are the priority. Key-value stores Memcached and more often Redis are often used for caching and sharing sessions and other state data in multiserver environment.

Graph databases are a rising trend in data persistence. Graph databases offer natural modeling capabilities for many types of data and will likely become popular in mainstream applications such as CMSes. Some popular Graph databases used for web applications with PHP are:

P is for PHP

PHP is the only absolute constant in LAMP applications. You can switch the other letters, but the language of the applications has always been PHP. After years of stagnation after delays (and eventual cancellation of PHP6 as such) there has been advancements in both the language and compatible runtimes.

The standard PHP distributions (oldest supported version being 5.5) are the most popular ones. An alternative one, HHVM from Facebook is also being used by Wikipedia and other large sites. Facebook itself has moved from PHP development to it's own Hack language (a fork of PHP), but the company plans to keep HHVM compatible with baseline PHP.

The notable effect of HHVM is the fact that it provided real competition to the standard PHP environment. Starting from PHP 5.5 the language included an opcode cache by default, increasing performance and reducing overhead of installing one manually. Work on features and performance continues to be a focus in the soon-to-be-released next version of the PHP language: PHP 7

Technically it's (likely) not LAMP any more

As you can see from above, it's likely that the LAMP applications you are developing nowadays probably include quite a few supporting technologies. This article did not even go to utilities such as Imagemagick and other specialty extensions.

Keeping this in mind, it's worth noting that WordPress a popular content publishing tool is by heart a vanilla LAMP application that can achieve quite a few things with it - such as changing the world if you've got important things to say to the world.

While LAMP does not necessarily describe the technology stack any longer, it remains a recognisable brand which we should hold on to. Coca-Cola does no longer contains cocaine, but it's still called Coca-Cola.

Is LAMP still relevant?

The internet is not a battlefield of technologies, but developers often tend to see is at such. LAMP has endured as a popular platform for a number of years. It used to be the nice little thing that allowed you to publish something on the interwebs - real quick. It still is.

As discussed, PHP is the only piece of LAMP you can't swap. PHP has evolved to be a capable language for building complex applications. It is still a great tool for this, but the rise of JavaScript both on server and client side is now becoming top-of-mind for a lot of developers.

PHP is continues evolving and becoming better than ever, but JavaScript has the unique advantage of being shared between the server and the client. This makes development more natural and fluent - even though writing code once and running anywhere is likely still a pipe dream. And who knows, maybe JavaScript is not the answer to all of life's problems. Maybe Go or Elixir are.

LAMP today offers a stable and mature platform that allows you to focus on results - not configuring your tools or following the latest trends. That (and the millions lines of code out there) makes it good choice for many things, despite it's shortcomings.

LAMP is not going anywhere, but it's no longer "the obvious choice" for getting started with web development.

Written by Jani Tarvainen on Saturday October 24, 2015
Permalink - Tags: php, mysql, lamp, linux

Leave a comment

comments powered by Disqus

« MySQL 5.7 brings sexy back with JSON - Symfony and Search: Lucene, Solr and Elasticsearch »