Ask HN: Database schema for a chat app designed to handle a billion users
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?