Summary
Atom Entertainment (a subsidiary of Viacom) produces the popular gaming site
AddictingGames.com. The site
currently delivers over 2000 interactive games, and attracts more than 21
million unique visitors per month. Quoin is building a new site
infrastructure and features to create an online community. In Phase 1 of the
project, our team is implementing tools to support user registration, game
rating, and reviews. We are collaborating with Atom Entertainment staff to
ensure that the enhancements support a more engaging user experience and
generate more page-views per visit.
The initial work for AddictingGames.com includes the following objectives.
- Redesigned Home Page – An improved look-and-feel highlights new games, and
displays a layover that displays the information relating to the game.
- Game Ratings – A registered user rates individual games using a "thumbs up
or thumbs down". The system maintains game ratings, including aggregate rating,
last 10 ratings, total number of ratings, and breakdown of ratings.
- Site Registration – A user creates basic credentials for the site. The
system supports CAPTCHA to reduce fraudulent accounts, email confirmation,
password recovery, and other account management features.
- Game Reviews – A registered user submits a review for a game.
- Moderation system – Automated and manual moderation of user content, such as
game reviews. The system allows a site administrator to accept or reject
reviews, automatically filter reviews that include banned words, and reject user
names that are potentially offensive.
Quoin has defined a system architecture that will support
future enhancements and significantly increased traffic The design is based on a
stateless, service-oriented architecture. Our team is using a user-interface
and component toolkit for interactive web applications that Quoin has developed
on a series of client projects. The system architecture will provide a robust
infrastructure for subsequent enhancements to the site.
Our team will implement additional features for user profiles in Phase 2 of
the project.
Architecture
AddictingGames.com currently sees a high volume of visits, and the volume is
expected to grow. In adding interactive features to site, we recognize that it
will be essential to maintain a responsive user experience and create a
server-side architecture that scales easily, linearly and at low-cost. We can
achieve this goal with two key architectural decisions. As much as possible, the
architecture will:
- Create a stateless service-oriented architecture for server components; and,
- Implement dynamic behavior entirely on the client.
Stateless Service Interface
A coarse-grained stateless service oriented architecture provides excellent
scalability – both through low per-server overhead as well as working well with
clustered or pooled servlet containers. By not keeping conversational state on
the server, but instead keeping non-security critical state in the client-side
dynamic component code, load is shifted to the clients, and server complexity is
generally reduced. Since interfaces to the services will be publicly callable,
they will be designed and tested to be very robust and secure.
A stateless model means that no conversational/per-client session state is
held on the server. Instead, all requisite information is either passed in from
the client or can be re-created in querying the backend data store. Each service
request results in only a short period of server resource usage. Since there is
no session-state, additional service containers (servers) can easily be added.
Load testing and performance tuning will ensure that server-side code and
database queries are optimized and that any bottlenecks are eliminated.
The MySQL database jumps out as both a scalability constraint and a single point
of failure. MySQL does offer a master/slave replication scheme, but updates only
flow from master to slave(s). In this configuration, two different database
pools would need to be used and code would need to separate database reads from
database updates – adding complexity and leaving the master as a single point of
failure. Another option to consider is
MySQL Cluster (),
which promises high availability and no single points of failure, however
introduces some limitations.
Client-side Components
A goal of the system architecture is to support interactive features entirely
implemented with client-side Javascript. One concrete example on the reviews
displayed – posting reviews could cause the page to be regenerated and cached
either to the file system or with a caching proxy server. The time posted (e.g.
20 minutes ago, 2 days ago, 3 months ago) can be calculated on the client side.
The static page content need only include the date/time in GMT that each review
was posted. A simple Dojo Javascript widget can use the user’s local time to
calculate and display these values. The page could then be statically served,
but the content would be dynamic. Due to the high volume and scalability
requirements, we will actively seek ways to move interactivity to the client
platform.
Managing Complexity
As multiple dynamic modules are introduced into a static page, we are
essentially created a client-side application with a rich user-interface. These
components can each communicate directly with server-side services.
Collaboration between multiple client-side components quickly becomes complex.
In order to manage this complexity, pages with dynamic components will use a
page-level controller which will facilitate loose coupling – for example using a
publish/subscription mechanism for connecting components. The modules
communicate with the server services.
Search Engine Optimization
The re-engineered site and pages with new interactive featrus must continue
to be understood by search engine spiders. Therefore, all critical information
will be generated as static XHTML – even if this content exists inside noscript
tags and is actually shown to the user in dynamic modules. Note that the
mechanism for instantiating Dojo XHTML widgets supports SEO by using JavaScript
to dynamically replace the XHTML nodes declaring the template instance with a
dynamic XHTML component.