Jump to: navigation, search

UDC/How is Usage Data Stored

< UDC
Revision as of 13:16, 22 September 2010 by Wayne.eclipse.org (Talk | contribs)

Overview

Usage data is aggressively normalized on the server. Ultimately, the data is stored in multiple tables.

Tables

Profile

A record is created in the profile table, usagedata_profile for each workspace we encounter. When the UDC uploads data, it provides us with two identifiers (both are UUIDs generated by the UDC) representing the user and the workspace. The user identifier effectively represents an individual computer; the workspace identifier represents an individual workspace. This distinction was deemed necessary in order to account for users who run multiple Eclipse workspaces.

A row is created in the profile table for each distinct userId/workspaceId pairing.

Table Description

The table contains an id field which is the primary key. This field is used as the target of the foreign-key reference from the Upload table.

+-------------+------------------+------+-----+---------+----------------+
| Field       | Type             | Null | Key | Default | Extra          |
+-------------+------------------+------+-----+---------+----------------+
| id          | int(10) unsigned | NO   | PRI | NULL    | auto_increment | 
| userId      | char(40)         | NO   | MUL |         |                | 
| workspaceId | char(40)         | NO   | MUL |         |                | 
+-------------+------------------+------+-----+---------+----------------+

Upload

Each entry in the upload table, usagedata_upload, represents an upload event. That is, every time the UDC "calls home" with an upload, we add a row to this table. Each row records the profileId of the user (from the Profile table using the userId/workspaceId combination provided with the upload event), the country code (ccode), and the time (on the server) of the upload.

Table Description

The table contains an id field which is the primary key. This field is used as the target of the foreign-key reference from a Record table.

+-----------+------------------+------+-----+-------------------+----------------+
| Field     | Type             | Null | Key | Default           | Extra          |
+-----------+------------------+------+-----+-------------------+----------------+
| id        | int(10) unsigned | NO   | PRI | NULL              | auto_increment | 
| profileId | int(10) unsigned | NO   |     |                   |                | 
| ccode     | char(2)          | YES  |     | NULL              |                | 
| time      | timestamp        | NO   | MUL | CURRENT_TIMESTAMP |                | 
+-----------+------------------+------+-----+-------------------+----------------+