CS 242 Fall 2011 : OLTP Simulator | charlie on software

CS 242 Fall 2011 : OLTP Simulator

This page last changed on Aug 08, 2011 by conadmin.


What is OLTP? OLTP stands for On-Line Transaction Processing. Think about an OLTP application as the kind of software that would process credit card purchases, banking transactions, or the stock market. In this assignment, we are going to simulate a stock trading environment, similar to what is done to benchmark many high end servers (in a former life, Charlie implemented one of these for a large server manufacturer).

The Assignment

Language: Java

Week 1 – Generating Customer Data

For this week, we will only be generating the customer data that will later be used in our simulation and writing unit tests to confirm that we have generated the data properly. Download the given files, graciously provided by The TPC. You will notice several files:

  • FemaleFirstName.txt – contains a list of female first names and relative frequencies
  • MaleFirstName.txt – contains a list of male first names and relative frequencies
  • LastName.txt – contains a list of last names and relative frequencies
  • StreetName.txt – “”
  • StreetSuffix.txt – “”
  • ZipCode.txt – “”
  • AreaCode.txt – “”
  • TaxRatesCountry.txt – “”
  • Company.txt – “”

Using the given data, you will be generating simulated customers to be used later. Each customer should have a:

  • first name
  • last name
  • full address
  • phone number (area code does not necessarily need to match zip code, we can assume they are cell phones)
  • employer
  • disposable income (you can randomly generate this figure)
  • wealth status based on income (poor, huddled masses, masses, well to do, or filthy rich, you decide the cutoffs)

You should generate customers using the relative frequencies of data given in the input files where they are given. Your main program should be able to be invoked from the command line and take 3 parameters as input:

  • the number of customers to generate
  • path to the directory containing the given input files
  • path to the directory to store output

These are the only parameters you are allowed to pass in to your program. Yes, this excludes any Java virtual machine parameters that may boost the heap size.

A simple API

In addition to being able to generate customers, you need to write an API interface to support the following operations:

  • find customer by name
  • find customer by address
  • find customers by zip code
  • find customers by area code
  • find customers by city (all customers in all zip codes in a given city)
  • find customers by employer
  • find customers by wealth status

It is up to you to determine how these functions work and how they return values, but remember, you are not allowed to increase the heap size in any way, so careful memory management is a must.

You are also not allowed to use any type of database for this week. This includes any RDBMS (including server-based and embedded), any document database, etc. Yes, we realize this is not something that would ever be done in the real world, but using a database trivializes the assignment!
Unit Testing

You need to write a comprehensive set of unit tests to verify that your program works as expected. Specifically, you need to test that:

  • you can generate any number of customers (for practical reasons, we will not ask you to generate any more than X million customers)
  • customers are generated according to the right frequencies
  • that each function in your API works as expected under all cases

We expect you to have at least 10-15 test cases, each with several assertions.

insert section on junit testing here

Week 2 – Simulating Trading

This week, we will simulate customers buying and selling stocks on an imaginary stock market.

ill develop this more if the idea for week 1 is ok

Week 3 – Database Porting and Performance Tuning

For this week, you will have two main tasks:

  1. port your application to use a database of your choosing
  2. performance tune your application to be able to handle a higher throughput

ill develop this more if the idea for week 1 is ok

cs242_oltp_input_files.tar.gz (application/x-gzip)
Document generated by Confluence on Feb 22, 2012 18:09

  1. No comments yet.

  1. No trackbacks yet.