Lightweight Models and Cost Effective Scalability

Today, large scale websites are amazingly complex systems. As a result of this (and other factors), many websites eventually run into problems such as cost, performance and scalability. In fact, the problem is so ubiquitous that it’s not highly uncommon for websites to undergo major re-engineering once they hit a certain size threshold, in order to effectively keep up with growth and demand.

Fortunately, there are concepts and methodologies that, if followed correctly and consistently, will help minimize the aforementioned problems.

One such important concept is choosing the right Web Application Stack. The stack is made up of various layers (see diagram below). At each layer of the stack, there are several technologies to choose from. Often they are interchangeable, resulting in many different combinations depending on what suites the business needs best (cost wise, performance wise etc.).

As a demonstration, I will be talking about the popular video website, YouTube. The reason I have picked YouTube is because it is well known and widely used, and also because it’s Web Application Stack is one that is very widespread on the World Wide Web today. It’s called LAMP.



LAMP is an acronym that stands for LinuxApache HTTP ServerMySQLPHP/Perl/Python. As you can see, it’s made up of all the technologies used at various levels of the stack. As I mentioned earlier, the levels are quite interchangeable, which is why you have other competing stacks such as:


Windows Server – Apache HTTP Server – MySQL – PHP/Perl/Python


Windows Server – IIS  – MSAccess – PHP/Perl/Python


Windows Server – IIS – SQL Server – ASP.NET

One of the most prominent reasons this stack has become popular is because of its free of cost, open source status. Many of todays big websites such as Google, Facebook, Youtube, Gmail, Digg, Wikipedia and Flikr use the LAMP stack.

Before proceeding further, lets define what scalability means. Scalability refers to the amount of data a website contains, and also the number of users it can simultaneously support. A scalable website is one that can easily support additional users and traffic by expanding hardware and bandwidth, without making changes to the software or structure of the website. If a website structure cannot cope with additional users, it has reached its scalability threshold.

Where does LAMP come in to all of this? Well firstly, as mentioned above, LAMP consists of free software, which makes it the perfect choice for Cost Effective scalability. As far as scalability itself is concerned, the software in LAMP, such as PHP allow for horizontal scalability. Each layer in the stack can expand and grow on its own, without having any unwanted effect on the other layers.

At this point, I’d like to mention the difference between scaling up and scaling out.

Scaling Up: This refers to upgrading already existing equipment, e.g. adding more RAM to the database server

Scaling Out: This refers to expanding the number of equipment working simultaneously, e.g. adding a second database server

Most times scaling up is more cost effective than scaling out, however over time scaling up will reach its limits and scaling out is inevitable.

Software in the LAMP stack encourages and supports scalability.

Apache – Multiple Apache HTTP Servers can be set to run in networked fashion (Load Balancing software such as NetScalar required)

MySQL – Some of the ways in which MySQL supports scalability is by providing:

Scalability for read-intensive applications through multiple slaves

Scalability for read/write-intensive applications using multi-master replication and partitioning

Scalability for heavily used web sites using MySQL Cluster

Read More…

In the case of YouTube, we know the following to be true today:

–          Over 1 billion views per day

–          Uses NetScalar for Load Balancing

–          Uses a LAMP implementation with Python

Youtube Statistics

Youtube Statistics

YouTube Logo

YouTube Logo

When YouTube first started off, it hosted only a handful of videos and did not require much hardware or bandwidth. Over the past 5 years, this has changed dramatically, and the LAMP software bundle has allowed YouTube to stay alive without crashing.

Commoditization of hardware, bandwidth and software has meant that prices have gone down lower, and it is much more feasible now. Since LAMP uses Open Source software, reusing existing code libraries means we can now *stand on the shoulders of giants* so to speak. No time is wasted re inventing the wheel.

Apart from this, there is also the concept of having a light weight model. In YouTube’s case, this can be seen by noticing how similar and uniform all the pages are. The use of templates in PHP means that the design of the entire website can be uniform and centrally controlled and expanded, without an increase in overhead. In other words, PHP templates allow greater versatility and much easier access when editing content.


LAMP Logo (Yes I was bored so I Photoshop'd it =D)


3 Responses to Lightweight Models and Cost Effective Scalability

  1. evansk56 says:

    You mention that the LAMP stack model is highly cost effective due too the fact that all the software associated with this model is free, but what about the hardware requirements? Web and Database Servers are not free. Can it be financially viable for small websites to use this model? If not can it be tailored to suit them?

    • shravan15 says:

      I think the hardware costs are dependent on how much traffic is coming into the website. An Apache web server can be setup on a linux desktop machine and if you’re running a small scale website, this might be enough. The majority of costs come from the licensing of the proprietary technologies such as SQL Server and Visual Studio etc. which LAMP does not have. That in itself makes it highly valuable for small scale enterprises and home business users.

  2. ba1dish says:

    “many websites eventually run into problems such as cost, performance and scalability”

    how do you ment to measure performace and scalability? e.g Facebook and twitter creates didn’t think that website would boom this far.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: