comment_votes table

The comment_votes table in the Reddit Clone Database Schema schema has 5 columns, with 2 foreign keys to users and comments.

Kept separate from post_votes rather than unified behind a content_type column, because these two are the hottest write path in the product and each deserves its own index and its own partitioning story.

Columns (5)

Columns of the comment_votes table
ColumnTypeConstraintsDescription
user_iduuidnot null, references users.id
comment_iduuidnot null, references comments.id
valuesmallintnot null
created_attimestamptznot null
updated_attimestamptznot null

Indexes (1)

  • (comment_id)

Relationships