nmalkin/kpi-dashboard — pull request #27 by nmalkin (2012-07-13 22:23:33+00:00)
Title: Pre-calculate reports, store them in CouchDB for retrieval

### Overview
As part of implementing #10, we're changing the architecture so that reports are pre-calculated (as much as possible) and stored in CouchDB. Then, when a request for a report is received, the server would just get the information from the database and pass it on to the user.

### More details
#### Prior process:
On every request, data was downloaded, the report was prepared, then sent back to the user.

#### Now:
Separately from the server, data is downloaded and stored in CouchDB. (This is done, manually for now, using the script `server/bin/update`.) The server sets up views in CouchDB that map/reduce the data into a form ready for the report.
On user request, the data is retrieved from the appropriate view and sent back.

#### Benefit:
Data download and report calculation only needs to happen once.