A High Availability Scalable Website
A High Availability Scalable Website
A High Availability Scalable Website
Abstract
Purpose – To recommend a Website hosting solution for RaisingMillions.com and demonstrate
real-life solutions grounded in reality that provides High Availability (HA) and best practice
standards
Design/Methodology/Approach – This paper reviews the real-world implementation of a
Website with ambition to grow from small to large.
Findings – The technology is readily available to scale slowly when needed, without the need to
invest in a server that is likely to last years on end. This does not however mean that the
application code does not need to be thoroughly planned out and designed for scaling from day
one.
Colleagues – During this paper I will refer to Josh Nesbitt, an Application Designer whom I shall
be collaborating with during implementation to get our application Online.
Practical Implications – The solution provides HA for web servers on a Just in Time (JIT) basis.
A systems analysis is recommended for implementing these ideas.
Before commencing this assignment I carried out an analysis of the problem. As this was not a
requirement I have included it in Appendices.
1 Introduction
RaisingMillions.com aims to be a world leading site to help raise money for charities across the
globe. The Application will be designed using an agile Web development framework - Ruby on
Rails hosted on a Linux server. Our core process involves collecting 1 Million images from
donators to charity. When a user uploads an image it will be saved into three image sizes; we will
therefore be dealing with at least 3 million images which will add up to a combined total of
~100Kb per image set, this does not include the additional text/images that people will upload nor
does it include the size of the Web pages. We will therefore be handling at least 1.5 Terabytes
(TB) of Data and even more bandwidth than that. A fair amount of data considering a Seagate
Cheetah hard disk takes 2.2 hours to read 1Tb at 125 MB/s. This complexity will have an impact
on hardware and software such as bandwidth, storage, and response times. My goal in this
research is to discover the opportunities in order to achieve in designing a scalable plan to host
our website that will begin with a handful of users and eventually be able to a million.
This paper sets out to identify:
The requirements of our site (See Appendices)
Software elements comprising a Web Application
Strategic deployment methods
Problems likely to be generated from a hardware perspective as a result of growth
Solutions for HA
Solutions for Data Management
A High Availability Scalable Website Stefan Debattista
This setup can scale to multiple application servers. Apache will distribute load to any number of
Rails processes running on any number of back-end machines. This basic architecture allows for
Rails to scale until the Web or database server falls over, however, as you might expect, these too
can scale up to multiple machines. See where were going here? We‟ll see how to do this in just a
bit.
2.2 Deployment
Deployment is the stage where the application is uploaded to a live Web server. It‟s when the
beer and champagne are supposed to flow, it will be written about in Wired Magazine and will
Page 2
A High Availability Scalable Website Stefan Debattista
become an overnight name in the WWW. Unfortunately (for the Marketers) it may not be that
easy, but fortunately for us (Techs) it gives us time to manage growth.
It is best practice to first deploy onto a development server (Thomas, Hansson, 2007). This
doesn‟t have to be, and indeed shouldn‟t be, the final deployment environment, nor does it have
to be on a heavy-duty machine just yet. The sole purpose of this stage is practise, and testing. A
code – test – commit – deploy routine (Thomas, Hansson, 2007) is good practice and worth
getting used to. It will highlight teething problems that are likely to emerge during real
deployment. It will also give clients, lecturers, and trusted friends the opportunity feedback ideas
and issues to us. The skills I will acquire during this stage are:
Server deployment
Migration
This will also allow me to begin monitoring and testing the server, at some point the Pentium 4
laptop sitting in the hallway is going to run out of resources! And measuring when this happens
will give an insight to loads the application produces on the server with x number of clients.
So far the application has been hosted on PCs, the development server during coding, and the
deployment server during the test stage. Now comes the time when we commit and deploy onto a
Web server. A Web server is essentially a more powerful computer that can usually be upgraded
and that is always connected to the Internet with a stable and static Internet connection. There are
three main options here:
To host the website yourself
To rent web space - although this gives you no control over the machine which renders
this type of service useless for us
To outsource it to a third party Web hosting company
Hosting in-house requires a WLAN link, Firewall, Router and Fast Internet connection (a 6MB -
T3 equivalent 1:1 connection to a provider like BT or Easynet costs in the region of £5,000 per
annum) as well as the Web / Domain Server itself. Web hosting companies will rent you a
Machine for a monthly price and generally provide a host of hardware support. Figures 3
demonstrates a real-life hosting service offered by one of the world‟s leading hosting companies –
Rackspace whom i requested a quote from..
Page 3
A High Availability Scalable Website Stefan Debattista
Page 4
A High Availability Scalable Website Stefan Debattista
As the amount of users increase more demand will be put on the Web server, Application Server
and Database server. Each element must be available to perform their functions (Microsoft
MCSE 70-293, 2004), and depending to how critical they are it is important to take steps to
Page 5
A High Availability Scalable Website Stefan Debattista
ensure that they are up and running as much of the time as possible. What are the resources that
are going to suffer? What needs to be done?
Wan (Internet)
Switch Router
Web, Database, and Storage Server
responsibility of the failed server‟s processes. This is called a failover, and when the
malfunctioning machine comes back online it can begin it can restart its processes, this is called a
failback (Microsoft MCSE 70-293, 2004).
Microsoft‟s solution technologies consist of server clusters and network load balancing. These
Microsoft solutions, a part of MS Server 2003, provide excellent support and integration with the
Windows environment.
Linux‟s HA concept is very similar to Microsoft‟s. Google amended Linux Red Hat for load
balancing (Harnur, 2000). They used 15,000 PCs to build the world‟s largest Linux cluster and
achieved nearly 100% uptime for processing over 150 million queries per day with <0.25 second
response time (Holzle, 2002; Barroso et al., 2003). Figure 6 demonstrates the concept behind this
technology whereby node A and B let each-other know they are still „alive‟ with a heartbeat.
Should a node fail the functioning node initiates a failover. A module called “rsync” constantly
synchronizes the files of the two nodes and the web server because of the frequent changes to web
contents.
Page 7
A High Availability Scalable Website Stefan Debattista
A SAN is a network connecting servers to storage to provide HA for data (Microsoft 2002;
Freedman, 1999) with Fibre Optic Cable. SAN devices generally deliver data really quickly (up
to 2Gbps) and connect up to 256 devices. A SAN is designed to eliminate single points of failure
and is the way forward for large disk capacities, fast delivery and high redundancy but at a much
greater cost to RAID.
3 Analysis
3.1 Components of a Web Application
Every application has its own unique setup and different requirements for accessing and
processing information. YouTube for example had unforeseen problems with their thumbnails.
Cyong Do talked about the realization that even though the team (of 7) were concerned with
delivering Video they did not envisage a problem with the little thumbnails. This issue was
caused by immense amounts of requests for data, unlike a video stream which involved one
request for the video to be played with one video came tens of thumbnail requests because from
the clients.
The thoughts and methodology behind the scaling of elements highlighted in this report in that
they are easily scalable by cloning the processes and distributing them onto multiple servers is
remarkable. It is a simple solution for a complex problem.
When it comes to dealing with the problems between applications and also within applications
themselves the basic principle is to simply the solution as much as possible and deal with it,
ensuring not to break something else.
3.2 Deployment
In the data driven world that we now live in, deployment solutions is not an issue. In an attempt to
quantify the volume, researchers reckon there was enough digital data in 2006 to theoretically fill
12 separate stacks of novels, each of which would extend the 93 million miles from the Earth to
the sun. By 2010, the accumulation of digital data would further extend these 12 stacks of books
to reach from the sun to Pluto and back! (McLean, 2007)
What is an issue however is coping with the vastness of the operating systems that Web
Applications, as are all applications, deployed on. There are simply so many things to consider in
setting up and maintaining a secure Operating System(s) that there are always major threats to the
Data.
A fail-proof backup backing up system is imperative because when everything is working -
everything is great, however should data get corrupted, deleted, or lost, business implications can
quite literally ruin a company and render it useless.
I believe deployment is a quick and painless process, because someone with something to deploy
will always have one of four options:
Hosting Providers where all one needs is a credit card
to access one of the countless hosting providers
A static IP at home and a small computer or set of
computers to experiment on
A largish system of his/her own at work, or a
company‟s cash to buy one
A beast of a system at work capable of thousands,
millions, or even trillions of processes every second
Page 8
4 Proposed methodology
My recommendations for the assessment and implementation of a hosting the
RaisingMillions.com computer system adopts a Systems Analysis process in terms of designing
and planning the system and a Just In time (JIT) methodology for implementing new ideas. This
is an established process for implementing better (usually more expensive or more complex) ideas
only when needed to keep overheads and time to a minimum. The Systems Analysis approach I
recommend consists four phases:
Phase 1 - Understanding the business needs
Phase 2 - Analysing systems requirements
Phase 3 - Analysing and making-decisions and
Phase 4 - Implementing the system
Phase 1
o Answering questions like Budget
o Timescales
o Realistic HA needs
o Realistic storage needs
o Speed
o Environmental considerations
o Risk log
Phase 2
o Specific technical requirements (Use Case Document, Wireframes)
o Research will help determine more precise hard disk requirements, processor
requirements, and backup.
o Operating system will need to be Linux to host Rails, but do we also need a
Windows server?
o Future technical requirements
o A checklist of functional requirements should be compiled.
Page 9
A High Availability Scalable Website Stefan Debattista
Phase 3
o Matching precise set ups with the constraints and requirements set out in Phase 1
and 2.
o Skills should be considered and technology appropriately chosen
o Testing - site should be loaded onto the deployment server.
o Technologies and their set-up will be detailed.
o Tests should be carried out to make implementation is as smooth as possible.
Phase 4
o Implementation/project plan with all above details detailed.
What I can envisage is demonstrating hosting the site being hosted on a small
cluster of laptops or virtual servers and switching off one demonstrating the
failback and failback features. Also implementing some sort of backup and
disaster recovery plan. It would also be interesting to explore S3 or EC2
depending on constraints
5 Summary
There is an unlimited amount of money one can spend, on an unlimited amount of ways to host a
Web Application because of the vast amounts of systems and services available on the market.
A website needs to support three types of areas of growth, these being processing, bandwidth, and
storage and one can achieve scalability by distributing these among multiple physical or virtual
servers. Usually the Operating System can take care of all these by means of clustering. Storage,
however, is nowadays managed by means of SANs (Storage Area Networks) although a cheaper
alternative is the older RAID Configuration which can still be affective if centralized storage is
not the key objective greatly minimizing management time. Database scalability is usually
handled independently of the OS by means of its intrinsic design; this is a DBA‟s role.
The important thing is to plan for the highest foreseeable simultaneous load on the systems
software and hardware. There is no point in investing in a massive infrastructure for a website
that may or may not become very popular. And becoming popular on the net is not as easy as one
may think.
The infrastructure available to us IT professionals is so vast that we can literally pick and choose
specific areas to invest money in to better performance, and the flexibility is unparalleled. Site
and server statistics help us to identify when to scale and by how much.
This paper has helped me gain a sound understanding of the systems supporting a website and the
importance of planning the architecture, not least to save money because of buying or renting the
wrong products or software. No engineer constructs a building without a solid plan in place and
neither should we.
Page 10
A High Availability Scalable Website Stefan Debattista
6 Appendices
6.1 Systems Analysis of computing needs
Table 1 - Measuring Availability Cited from Yan Han – An Integrated High Availability Platform
Page 11
A High Availability Scalable Website Stefan Debattista
7 Bibliography
1. BONDI, A B. 'Characteristics of scalability and their impact on performance',
Proceedings of the 2nd international workshop on Software and performance,
Ottawa, Ontario, Canada, 2000, ISBN 1-58113-195-X, pages 195 – 203
2. Video: YouTube Scalability. Google Tech Talk. CYONG DO (and an elite group of
scalability ninjas). Google: 2007.
4. BOOCH, G. 2001. IBM: The architecture of Web applications [online]. [03 March 2009].
Available from World Wide Web:
http://www.ibm.com/developerworks/ibm/library/it-booch_web/
7. RAID. 2006. Wikipedia: Redundant array of independent disks [online]. [04 March
2009]. Available from World Wide Web:
http://en.wikipedia.org/wiki/Redundant_array_of_independent_disks
8. MCLEAN, D. 2007. There’s how much data? 15/03/2007. Internet News [online]. [06
Mar 2009]. Available from World Wide Web:
http://www.websearchguide.ca/netblog/archives/005907.html
9. Whitten, J.L., Bentley, L.D., Dittman, K.C. (2001), Systems Analysis and Design
Methods, 5th ed., McGraw-Hill, Boston, MA, .
10. eWeek (2004), "Marketplace to the world", eWeek, Vol. 21 No.35, pp.22-4.
11. Marcus, E., Stern, H. (2003), Blueprints for High Availability, 2nd ed., Wiley, New York,
NY.
12. Harnur, S. (2000), "Google relies exclusively on Linux platform to chug along",
available at: www.hpworld.com/hpworldnews/hpw009/02nt.html (accessed 26
October 2004), .
13. Holzle, U. (2002), The Google Linux Cluster, University of Washington, Seattle, WA,
available at:
www.cs.washington.edu/info/videos/asx/colloq/UHoelzle_2002_11_05.asx (accessed
26 October 2004), .
14. Microsoft (2002), Microsoft Computer Dictionary, 5th ed., Microsoft Press,
Washington, DC, .
Page 12