Project 3

CS290F Fall 2006 - UCSB Computer Science - Thorsten von Eicken

Jump to: navigation, search
  • Handed out Monday October 30th, 2006
  • Part A due Monday November 6th, 2006
  • Part B due Wednesday November 15th, 2006

Important

  • Projects 1 thru 4 are to be done in groups of 2 (two). Each group must hand in a single solution with both group member names on it. If your partner is dropping out of the course, email the instructor as soon as possible.
  • A lot of resources are available on-line and in the library. It is great to use these, but please always cite them in your projects.

Objective

Project 3 consists of completing your web site and laying the base for scaling it. You will need some notion of users accounts, logging in, keeping track of (http) session data, and performing transactions. Again, for the bookstore example, users could create an account, log in, browse books, add individual ones to their shopping cart (session data), and check-out (transaction).

Part A

The purpose of Part A is again for you to define what you will accomplish in project 3 and for us to give you early feedback on these plans.

Define the functionality of your project 3 by updating or adding an additional page to your project's wiki page. In particular include:

  • Update your description of the models / tables.
  • Update your description of the controllers and their functionality.
  • Describe the "critical path" for scalability, which is the sequence of pages that you expect most users to go through. This is the set of pages that you will optimize, scale and benchmark in project 4. Typically this critical path consists of 2 to 3 "flows" through your site. In the book store example, two flows could be:
    • home page, search by title, show first result, show second result, add to cart, checkout
    • home page, search by author, show first result, show 3rd result, search by title, search by different title, show 2nd result, show 4th result (no checkout)

Part B

Implement your web site according to the Part A description using Ruby on Rails, the WEBrick development server, and a Mysql or PostgreSQL database. In addition you will deploy your web site on Amazon EC2.

Your web site should have the following functionality:

  • A medium-large dataset (probably on the order of 10'000 records, details forthcoming) for your 'production' site (keep a small dataset for your development!). The goal being that you can tell whether you need indices.
  • Fully implement the features that are exercised by the "critical path" defined in part A. It is important that the pages have all the elements/data required, which ensures that all the database accesses that need to occur actually do occur.
  • Implement user accounts and authentication. The acts_as_authenticated plugin is highly recommended for this purpose. (You can implement roles as well, but that is not really necessary, you could simply have one "superuser" account that can access the functions that are not available to normal users. Keep it simple.)
  • Implement the remainder of the site so it is functional, but don't spend time polishing it. You only need it in order to make the whole thing work.
  • For each of critical sequences that you have identified in part A, list the database operations that are issued in the production environment: traverse these pages manually and collect the SQL statements from the log. (This should result in about 10-20 unique queries, if you have many more you should probably focus your critical path more.)
    • Mark the DB operations that you believe could be eliminated (optimized away).
    • Mark the DB operations that should have an index to improve performance, use the EXPLAIN SQL statement to show the before/after comparison.

In addition, you must do the following:

  • Use source code control to manage your code base using the provided subversion server or your own svn/cvs server.
  • Deploy your web site on an instance of Amazon's Elastic Compute Cloud.
  • Have capistrano deployment scripts to automate loading the production database and deploying production code.
  • See deployment for links to resources

What to turn in

  • Use the turnin program to turn the source code of your app in.
  • Run your service on one EC2 server, give the instance a nickname composed of your project name and "project 3" (we will terminate the instance).
  • Update the wiki pages for your project as requested in parts A and B (i.e. including the DB operations list).
Personal tools