system, what works is not a single machine running
a single application but a cluster of machines
running a distributed application in a multi-tiered
architecture. Typically, in a multi-tier architecture,
the software system is divided into layers or tiers,
organized into the web-tier, middle-tier and data-
tier. Each tier has a cluster of machines each running
a piece of code that specializes in one or more tasks
pertaining to that tier. Although each software
program residing on an individual tier may appear to
be simple and is hosted by a cluster of relatively
inexpensive hardware, the combined effort among
these simple programs running in a distributed
manner can fulfil complex business requests.
The power of scalability achieved through
division of task and cooperation of effort is a
different design philosophy from developing
traditional standalone system or client/server system
with fat clients and highly coupled central server
system. The computing logic in a traditional system
design is accomplished by one sophisticated
monolithic program. Though the monolithic
program is very powerful, it is hard to scale because
the logic is tightly coupled and must be one on a
system that is limited in capacity. In a multi-tier
architecture, the computing logic is separated into
multiple pieces where each piece can be hosted and
computed independently by one or more machines.
In fact, machines running a copy of the code can be
added or removed to meet load demands.
2.2 State Minimization Design
Besides having a multi-tiered architecture, our
experiences find that minimizing state tracking
enhances a web-based system’s ability to provide
scalable service as well. Traditional server software
system prefers to keep track of client states. This is
the strength of server centric system. Stateful server
systems often work very efficiently due to the
knowledge it needed to perform a task is readily
available. However, the state oriented server design
principle is only efficient at small-scale level and
does not work well under large-scale web-based
application.
Minimizing state tracking leans to a more
scalable system. When we minimize the use of
state-ful session beans in EJB system or
conversational service in Tuxedo system, we find it
much easier to scale, load balance and provide
failover capability for the system. A system that has
less state to keep track is easier to redirect user
requests from one web server to another and easier
to share and redistribute loads amongst the servers.
In a web-based system, this is important because as
the web system load increases, it means easier to add
more machines and run more instances of the
applications to distribute the load without having to
worry about replicating user states amongst the
servers. Therefore, whenever possible, avoid state
tracking.
Making applications stateless, on the other hand,
is not always possible. For example, without state,
how can we keep track of a shopping cart? The key
to scalable state tracking, when state is necessary to
your system, is to consolidate the state information
and save into a common place, such as database
server. The database server can be viewed as a
sophisticated state-ful engine that is capable of
handling system crash and data recovery. When
storing state data, we find that it is better to store
state data, which is temporary in nature, into a
different database server from that of the business
data, which are durable. This allows us to apply
different backup strategy base on the nature of the
data.
2.3 Workflow-oriented Design
Another practice that helps with scalability in a web-
based system is a workflow-oriented design. In
traditional software development, a task is
accomplished through a series of steps that are
executed in a sequential and synchronous manner.
Response is not sent to users until all the steps are
finished. However, in a web-based system, this
synchronous task accomplishment model may not be
scalable for large number of users and requests.
Instead, a workflow model based design is often
helpful in many cases. In a workflow model, user
requests are queued and processed asynchronously.
The workflow model makes task accomplished in a
pipelined manner to promote parallel execution for
each step and improves the overall system
throughput.
3 DESIGN FOR MAINTENANCE
AND ROBUSTNESS
While scalability is important to web-based systems,
robustness cannot be overlooked. The robustness of
a web-based system is dependent on the
maintainability of the system.
3.1 Robust Error Handling
In a multi-tiered web-based system where the code
is spread over a number of machines comprising of
the various tiers, it becomes more difficult to track
down problems and keeping the system running
ICSOFT 2007 - International Conference on Software and Data Technologies
402