Information Technology Reference
In-Depth Information
listeners. A good resource for using message bus architectures is Enterprise Integration
Patterns: Designing, Building, and Deploying Messaging Solutions by Hohpe and Woolf
( 2003 ) .
4.6.3 Example 1: Link-Shortening Site
A link-shortening site very much like bit.ly had a message bus architecture used by its
componentstocommunicate.Theapplicationhadtwouser-visiblecomponents:thecontrol
panel (a web UI for registering new URLs to be shortened) and the web service that took
in short links and responded with the redirect code to the expanded URL.
The company wanted fast updates between the user interface and the redirect servers. It
was common for users to create a short link via the control panel and then immediately try
tousethelinktomakesurethatitworked.Initiallytherewasamulti-minutedelaybetween
whenthelinkwascreated andwhentheredirection service wasabletoredirect it.Thenew
link had to be indexed and processed, then added to the database, and the database changes
had to propagate to all the redirection servers.
To fix this problem the company set up a message bus system that connected all ma-
chines. There were two channels: one called “new shortlinks” and one called “shortlinks
used.”
As depicted in Figure 4.6 , the architecture had four elements:
Control Panel: A web frontend that was the portal people used to create new
shortlinks.
Main Database: A database server that stored all the shortlink information.
Trend Server: A server that kept track of “trending links” statistics.
Link Redirect Servers: Web servers that received requests with short URLs and
replied with a redirect to the expanded URL.
Search WWH ::




Custom Search