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

https://news.ycombinator.com/item?id=42260412
by curiousmindz • 2 years ago
2 2 2 years ago

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?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com