link_previews table

The link_previews table in the Reddit Clone Database Schema schema has 10 columns, keyed by id.

The oEmbed and OpenGraph cache, keyed by a hash of the URL because the URL itself is too long to index. Two thousand posts linking the same article fetch it once.

Columns (10)

Columns of the link_previews table
ColumnTypeConstraintsDescription
iduuidprimary key
url_hashvarchar(64)unique, not null
urlvarchar(2000)not null
titlevarchar(300)
descriptionvarchar(1000)
image_urlvarchar(2000)
provider_namevarchar(100)
embed_htmltext
fetched_attimestamptznot null
expires_attimestamptz

Indexes (1)

  • (expires_at)