---
title: "Database Design for Twitter/X"
url: https://daily.dev/posts/database-design-for-twitter-x-3fankvoev
source_url: https://www.youtube.com/watch?v=T8VOHriVyfg
type: video:youtube
source: "Database Star"
published: 2026-05-31T07:44:17.543Z
updated: 2026-05-31T07:56:59.133Z
tags: ["database", "sql"]
reading_time: 5
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Design for Twitter/X

**[Database Star](https://daily.dev/sources/database-star)** · 5 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of a simplified Twitter/X database schema covering core entities: users, tweets, likes, replies, retweets, followers, and media attachments. Explains the ERD step by step, highlighting many-to-many relationships (followers, likes), self-referential tweet replies, and trade-offs like storing retweets in a separate table vs. a column. Also touches on performance considerations such as counting likes at scale and the option to cache approximate counts in the tweet table.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=T8VOHriVyfg>

---

Tags: [#database](https://daily.dev/tags/database), [#sql](https://daily.dev/tags/sql)

[View this post on daily.dev](https://daily.dev/posts/database-design-for-twitter-x-3fankvoev)
