Fall 2009
Programming Assignment 1: Whisper.com: A Centralized Micro-blogging Service
Due: Oct 19, 2009
Since Whisper hopes to one day make whisps more popular than tweets, they would like to use sound design principles to design their online site in order to allow for future growth. The site will employ a two tier design - a front-end and a back-end. The front-end tier will accept user posts and perform initial processing. The backend consists of a data management tier that stores new posts in a "database" and retrieves whisps for clients that have subscribed to them.
The database can be a simple file on disk; each whisp entry should contain at least the following fields: timestamp, posterID, whispID, whisp comment.The posterID is of the form @username, and each client is assumed to have a unique username. The whispID is of the form #topic and is restricted to the three topics listed above. The whisp comment is a free text comment that is restricted to 50 characters or less. You may optionally maintain an index on the database file for faster searching (if no index is maintained, queries on the database will need to be done as a linear search).
The front end server supports four operations:
The database server supports two operations: query and store. The post operation allows the datbase to store a new whisp to the database file and has the form store(timestamp,@username,#topic, blog-comment) The query operation should allow a #topic and a time-stamp to be specified and return all posts on that topic since the specified time-stamp.
Assume that each client process follows (subscribes to) a subset of the available topics. The client should periodically post a comment on those topics and also retrieve all subscribed whips periodically.
It is important to handle errors gracefully without crashing the process. For example, if the comment exceeds 50 characters or an incorrect timestamp or an invalid topic is specified, the front-end tier should return appropriate errors.
Make necessary plots to support your conclusions.