experiment_assignments table
The experiment_assignments table in the Reddit Clone Database Schema schema has 4 columns, with 2 foreign keys to experiments and users.
Assignment is stored rather than hashed on the fly, so a rollout change mid-experiment cannot silently move somebody between variants and poison the result.
Columns (4)
| Column | Type | Constraints | Description |
|---|---|---|---|
| experiment_id | uuid | not null, references experiments.id | |
| user_id | uuid | not null, references users.id | |
| variant | varchar(40) | not null | |
| assigned_at | timestamptz | not null |
Indexes (1)
(experiment_id, variant)
Relationships
experiment_assignments.experiment_idreferencesexperiments.idexperiment_assignments.user_idreferencesusers.id