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)

Columns of the experiment_assignments table
ColumnTypeConstraintsDescription
experiment_iduuidnot null, references experiments.id
user_iduuidnot null, references users.id
variantvarchar(40)not null
assigned_attimestamptznot null

Indexes (1)

  • (experiment_id, variant)

Relationships

  • experiment_assignments.experiment_id references experiments.id
  • experiment_assignments.user_id references users.id