Spring 2017
Programming Assignment 2: Asterix and the Olympic Games (Summer Games edition)
Due: 11:55pm, Friday March 30
Assume that the front end servers not only receive requests for scores but one of them also receives score updates from the Cacofonix process and then sends an update to the database tier.
You only need to implement client-pull for this lab. Server push funcitonality is not needed. Further, while the API exposed by front-end servers is identical to lab 1, you should implement your own internal interface to handle interactions between the front-end and back-end processes (you can deisgn it any way you wish and this interface should be documented in your README file). Please use the same REST web API for the front end servers that was used in Lab 1.
Load balancing across web servers: Since the front end server is replicated, you need to implement a load balancing mechanism to ensure that clients are load balanced across the two front-end tiers. This could be done in one of many ways. For example, the server could maintain a dispatcher process that keeps track of the number of clients assigned to each front end server. A new client can query the dispatcher and it can point the client to one of the two front-end servers based on the current load. The dispatcher should also update the load, which in this case is the number of clients assigned to each front end server, based on this assignment. Other more complex scenarios are allowed if you wish to be more creative with this part.
Every 100th request to the stone server is automatically entered into the raffle. However requests arrive concurrently to the two front-end servers, the stone server needs to be able to derive a total ordering of all incoming requests to flag every hundredth request. The Gauls are sticklers are precise synchronization and are unwilling to accept the error tolerence provided by the Berkeley algorithm in Part 2. Also atomic clocks are yet to be invented.
To address this issue, we will use totally ordered multicasting using Logical clocks. The two front end servers will maintain a logical clock that be incremented upon the receiving each client request. As in totally ordered multicast, each request is buffered. The arrival of each client request is multicast to other front end replicas and logical clocks and totally ordered multicast protocol is used to derive a total ordering of all incoming requests. Every hundredth request in this total order is then chosen for the raffle entry.
Please note that end-clients do not need to implement logical clocks. They are internal to the front-end servers. Please refer to class lecture slides and the replicated banking example for totally ordered multicasting in sec 6.2 of the textbook to understand how to implement this part.
Again, every hundredth request is entered into a raffle. At the end, randomly choose a winner from all raffle entties.
Like before assume that there are N tablets, each of which is a client, that needs to be periodically updated with sports scores. (N should be configurable in your system).
Like before, Cacofonix, the village bard, is responsible for providing Obelix's server live updates from the olympic stadium, which he does by singing the scores and thereby sending updated scores to one of the front-end servers.
You are free to develop your solution on any platform, but please ensure that your programs run on the edlab machines (See note below). Please speccify whether your are using Python 2 or Python 3 in your design doc.
Make necessary plots to support your conclusions.