I did some reading on how to put a web application together on the cheap. There are many options available, and I decided to evaluate them. I started with what many consider the bread and butter of open source web development tools: the LAMP stack. LAMP stands for Linux, Apache, MySQL, PHP - an operating system, web server, database, and development language, respectively, widely used across the internet from the smallest sites to some of the largest and most successful.
Using the first two pieces of that stack - the operating system and server software - is largely a matter of downloading, installing and configuring them. These basic system administration tasks are a routine matter of reading and following documentation, until one faces the task of scaling an application to handle a high level of visitor traffic.
The real design work, then, lies in creating the database schema, writing the application layer, designing the graphic layout of documents served to the client, and writing client-side application logic (if any).
Writing a standard web application requires some understanding of quite an array of languages and technologies. Keeping our focus on this standard LAMP architecture, we must know SQL to create and access a relational database. We must know PHP to implement the core application logic and map objects in memory to rows in database tables. We must know the HTTP protocol and the details of request and response methods, headers and status codes in order to specify content types, control caching behavior, track visitor sessions, control access to content, support different locales, guard against attacks, and a host of other considerations. We must know HTML to create the structure of pages which may include complex interactive elements such as user-submitted forms, and to add semantic meaning to that structure. We must know CSS to control the look and feel of those structured semantic documents. We must know javascript (the de-facto client-side language on the web, though flash is also worth a mention) if we wish to add dynamic behaviors to otherwise static pages, and we must deal with idiosyncrasies in the way different web browsers handle the combination of HTML, CSS and Javascript. For any other services we interface with, we must be able to work with machine-readable formats for structured data such as XML, JSON, likely using conventions specific to each service.
For these reasons, creating a web application can be a complex undertaking. We'll want a design broken into modules that deal with each of the challenges presented above, loosely coupled enough that we may easily swap them out for alternative tools from other sources, but integrated enough that they work without requiring whole extra layers of repetitive 'glue code' or configuration files. We'll want to separate responsibilities in a way that keeps each module clear and understandable for the designers and any maintainers or testers that come after. A PHP application can be written in a single document, with logic and presentation interwoven (the PHP language actually encourages this) but in a good design, we want to avoid that.
It is worth considering at this point that many of the above issues have already been solved by thousands of applications running on the web today. There are some very large, very active communities of developers and designers sharing ideas and code, and improving on one another's work.
As we attack this problem, we seek leverage. We'd like to draw from some of the best design ideas available, and concentrate as much as possible on the challenges that are unique to our particular project. Since there are so many alternatives available which we may immediately download and use, narrowing the field and evaluating a few top contenders becomes a useful skill.
To narrow the field, there are some non-technical considerations that, while not directly related to technical merit, make great practical heuristics. Top among these, arguably, is the presence of an active, passionate, and helpful community developing the tool. An active community will likely keep a tool up to date with new improvements, keep the documentation up to date and help new users, publish books and tutorials, subject a tool to a lot of real-world testing, bring new people into the fold, and keep this virtuous cycle alive. That implies that our investment in learning and building on our chosen piece of software will pay dividends well into the future.
With that in mind, I focused on two of the best-regarded web frameworks, based on a substantial amount of online reading, both with very active communities, both based on powerful, elegant scripting languages (which themselves have great communities), both adhering to a DRY ("Don't Repeat Yourself") principle of design, and both possessing great documentation and tutorials: Ruby on Rails (which uses the Ruby language, as the name implies), and Django (which uses Python). I read blog posts, followed tutorials, experimented with small projects, and even watched screencasts (both communities have a few members who publish video podcasts with narrated, screen captured walkthroughs covering particular features of their tool). I read two books covering Rails development and one covering Django.
So, what is it like to create an application using these two tools?
Go to Part 2