Monday, December 27, 2010

New Tech paradigm - LN3

So if LAMP is being replaced what is it being replaced with, I think its a combination of these:
  • Linux
  • NoSQL
  • Node.JS
  • NgineX
So what to call it, How about LN3

Saturday, December 11, 2010

Node.JS and the way forward

One issue with many web development languages such as PHP or python is that all IO is blocking. So every time a program goes to the net, disk or database the thread or process blocks. It stops what it is doing and waits until the data comes back from the disk or network.  In a heavily loaded server which is being bottlenecked by disk or network this can result in a great number of processes in disk or network wait states, this is less than ideal when trying to scale.

One novel program that is trying to deal with this is Node.JS. Node is a server side javascript enviorment that uses the Javascript event loop to work around this. Similar to the way Javascript will do AJAX on the browser Node.JS will do all its IO with a callback. In theory a single Node process can support thousands of users by never blocking on IO. I hope to play with Node.JS soon.

Tuesday, November 2, 2010

Options in NoSQL

For 90% of projects done with PHP and similar tools the database engine of choice is MySQL, (Postgress gets a large chunk of what is left). So when starting a new project using PHP, Python, Ruby etc the choice of a data store will default to MySQL and in some cases that is great. There is still the choice between myism and innodb tables but that one tends to be pretty easy.

However of late 'NoSQL' has become all the rage with new data storage engines showing up every so often.
The Developer faces a few challenges when moving from MySQL to one of these NoSQL engines.

1) Most web developers understand MySQL pretty well (we hope). We know how to index things, how to layout tables etc. This level of know how has not yet been established with the new NoSQL products.

2) The tools like phpMyAdmin and such for MySQL have been around for a while and are pretty well established

3) There are at least three big NoSQL data stores in the free software arena. (CouchDB, MongoDB and Cassandra) While competition is very much a good thing for the programmer who is not familiar with these products having to try to figure out which one to use in any given case can be a bit problematic.

I expect all three of these issues will start to go away over the next few years as the tech literature catches up to the software

Monday, November 1, 2010

LAMP: PHP is past its prime

If one part of the LAMP stack has to be the week link at this point it is PHP. PHP is a great language for doing little things but as web applications get more complex it is showing its limits.

PHP suffers from a few major problems:

  1.  The need to have a <?php tag at the top of any file, and having the script send anything outside of the <?php tag to standard output.
  2. Almost no ability to do any form of asynchronous operations 
  3. Vulnerability to injection and XSS attacks (Though many languages have this problem)

There is also the fact that as languages go PHP is just not very elegant. spend a few hours with python, ruby or javascript and PHP will feel painful. 

Sunday, October 31, 2010

Exploring New Tech

We seem to be bringing a lot of new web development tools online in the last 18 months or so. The problem is that many of these tools will require a major change in how web development is done. New tech to think about


  • Node.JS (Async I/O)
  • NoSQL (MongoDB, CouchDB, Casandra)
  • HTML 5 web workers
Part of the reason for this blog is to start the conversation on how to use these new tools. 

Web Workers Best Practice

Web workers are a cool new part of HTML 5. They allow background processing in Javascript in the browser which has not been possible before.

However the best methods to approach them is less than obvious. I have come up with a few things


  • Functional Programming 
  • Simple code
  • breaking up large jobs into small parts
Any other ideas?

But really I am thinking that this needs to be out there for 2-3 years before we really figure out how to use the things.


LAMP: Cracks in MySQL

MySQL is a great database. It has a lot of good features and is reliable in a great many use cases. However it sometimes hits its limits, some of these are specific to MySQL some are general issues with SQL databases in general. 


  1. SQL does not scale out very well. If you need to shard a dataset across servers
  2. Tunning can be  bit of an art form. 
  3. SQL is can be subject to injection attacks. (See the cartoon)




Friday, October 29, 2010

LAMP is dimming

For most of the last 10-15 years the LAMP suite has been one of the major modes of web development. LAMP is composed of four parts,

  • Linux
  • Apache
  • MySQL 
  • Perl, PHP or Python
While Linux will stay as part of the standard developers stack for years to come the other three parts of the lamp  suite seem to be getting a bit crufty.

Apache is a fine web server, but it is using a multi process model. Each connection ties up a process. As connections become longer lived with new technology like Commit the memory usage of an apache server tends to grow heavily. Event loop technologies like nginx and node.js may soon take over. For delivering static pages apache still has much to recommend it. 

Next time Cracks in MySQL

The Future of Web Programming

The future model of programming applications will be moving to the web more and more over the next few years. For those of us who have been doing we programming since rocks were soft and dirt was fresh new idea (i.e. 1993) this can only be a good thing. This blog will seek to explore programming methodologies that are on their way in and on their way out.