Jump to: navigation, search

Difference between revisions of "UDC/How is Usage Data Stored"

< UDC
(New page: =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, ''usag...)
 
Line 8: Line 8:
  
 
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 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===
 
===Table Description===
Line 20: Line 22:
 
| workspaceId | char(40)        | NO  | MUL |        |                |  
 
| workspaceId | char(40)        | NO  | MUL |        |                |  
 
+-------------+------------------+------+-----+---------+----------------+</pre>
 
+-------------+------------------+------+-----+---------+----------------+</pre>
 +
 +
==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.
 +
 +
<pre>+-----------+------------------+------+-----+-------------------+----------------+
 +
| 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 |                |
 +
+-----------+------------------+------+-----+-------------------+----------------+</pre>

Revision as of 14:16, 22 September 2010

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 |                | 
+-----------+------------------+------+-----+-------------------+----------------+