Discussion

Ask HN: Database schema for a chat app designed to handle a billion users

I am very curious about how chat messages are stored for a "billion-users" chat app (in SQL databases).

Specifically, let's say a user is part of a hundred conversations. When their client app comes online after being offline for a few days, how does the server query all the messages that are pending for this client app?

Does the server run one query per conversation? Or is there a fan-out process for each user so that the server can run one query per user? Or something else?

2 points curiousmindz 1 year ago 2 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton