Information Technology Reference
In-Depth Information
Figure 4.6: Link-shortening architecture
When any control panel server received a new shortlink from a user, it would publish it
on the “new shortlink” channel. Subscribers to that channel included the database (which
stored the new shortlink information) as well as all the redirect servers (which stored the
new information in their lookup cache). When performing a redirect, each redirect server
reliedoninformationfromitslocalcacheandconsultedthedatabaseonlyincaseofacache
miss. Since it could take minutes or hours for the main database to ingest a new shortlink
(due to indexing and other issues), the message bus architecture enabled the redirect serv-
ers to always be up to date.
When a redirect server used a shortlink, it would publish this fact on the “shortlinks
used” channel. There were only two subscribers to this channel: the main database and the
trend server. The main database updated the usage statistics for that database entry. The
trendserverkeptanin-memorydatabaseofwhichURLshadbeenusedrecentlysothatthe
company could always display an accurate list of trending URLs.
Search WWH ::




Custom Search