Wednesday, April 10, 2013

Computers in Libraries 2013 - Day 2 - Out the Lamp

This was the second presentation at this year's CIL that featured John Blyberg of Darien Library, and this time he was the sole speaker.  His topic this time was trends away from elements of the standard LAMP (Linux, Apache, MySQL, PHP) stack that is used to drive a huge number of websites and the most popular content management systems (Drupal and Wordpress being notable examples).

First Blyberg went over the history of LAMP and its components, which range in age from 18 to 22 years making them all old enough to vote if they lived in the U.S. and were actual people (Linux, the 22 year old, could drink too!)

Then, after describing what made the components great and popular in the first place, he described several upstarts that threaten the position of the components (at least the "AMP" part of LAMP; Linux doesn't have much threatening it at the moment).  I had at least heard of most of these components, and in some cases I have heard people involved with the projects themselves interviewed on FLOSS Weekly, but it was good to have a concise run-down of them going over what makes them attractive and what the consequences of their success will be.

The big shift that Blyberg pointed out was that from a process driven model to an event driven model.  In a process driven model each time something happens on a server a new instance of the program needed is started up.  He likened it in his presentation to a restaurant that has a different server and a different chef for every single table where someone might be served.  There are some inefficiencies in this model (as might be obvious from the restaurant description) that have been acceptable so far, but as the Internet has had higher and higher levels of traffic, servers have wound up having to become more and more robust to handle the levels of traffic using process driven systems.

In the event driven model the situation is more like restaurants that we do have (because that's the way they can make money).  At least for a small restaurant there might be one chef who can cook all of the food for 15-20 people at a time and there can be one server who can handle taking orders and getting the food to the customers.  That is essentially analogous to an event-driven model.

Nginx and Node.js were the primary event-driven software packages that are changing the web landscape.


Nginx – An event-driven web server.   If Apache is program that has a million options but the average user only needs 6, Nginx  is a program that doesn't do much more than those 6 things but does the 6 things really well.  The project is 8 years old, low-resource, well-suited to virtual environments, easy to configure, and fast.  Of the software Blyberg mentioned, this is the only one that I have so far actually used.

Node.js – A server-side Javascript environment that can be used in a billion ways, but was born to be a highly flexible, powerful, event-driven web server.  It is 4 years old, built on Google's v8 Javascript engine, is self-contained, has its ownbuilt-in web server, is non-blocking, has asynchronous I/O, and a package manager to easily add features.

Node.js has the potential of replacing both Apache and PHP in many situations as it can both serve the web page (what Apache does) and provide the server side code to provide different, conditional versions of a web page (what PHP does).

Often (although not always) working closely with event driven software and in many cases replacing the M in LAMP (MySQL) are a a family of (so called) NoSQL projects which avoid some of the speed bottlenecks that MySQL can have.  Blyberg mentioned two of these as well.

MongoDB – A 4 year old extremely popular NoSQL (or document) database which was built for scalability, was designed to woo SQL developers away from MySQL (and maybe another SQL project called PostGres), and has gained broad support.

CouchDB – An 8 year old NoSQL database which has a fanatical user base, was built for distributed and off-line environments, great for mobile devices (is extremely common on Android phones), is an official Apache project, has an administrative interface built-in, and speaks exclusively in JSON (JavaScript Object Notation) making it play quite nicely with Node.js.

Blyberg briefly mentioned the popular search tools Apache Solr and Sphinx in that they work well with both MongoDB and CouchDB.

Redis – This is a 3 year old NoSQL database, stores data in memory, has an option to store to disk, is perfect for data caching, is used in high-I/O applications, and is ridiculously fast.  It was the primary project Blyberg mentioned that I'd never heard of, although given its nature I don't see myself really needing to use it either.

Blyberg ended by saying that these tools will be in the next few years be giving us a new family of Content Management Systems that will be much faster and more powerful than the CMSs we use today.

No comments: