Daily iOS
iOS system design

IM message reliability and local schema

In a messenger app, what does the client have to guarantee so messages never get lost? Cover acks and resends in both directions, ordering, and deduplication.

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The sender stores the message locally first (sending) under a client-generated id and resends from the outbox until a server ack (which assigns a server seq) arrives, while the server dedups by client id. The receiver checks that per-conversation server seqs are contiguous, pulls to fill any gap, and sends a receive ack.

Share a question