Ask HN: Database schema for a chat app designed to handle a billion users
https://news.ycombinator.com/item?id=42260412I 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?