How do delivery and read receipts work?
Sketch your own answer first, then compare it with the one below.
A strong answer
Sent means the server stored the message. Delivered means the recipient's device acknowledged it. Read means the recipient opened the conversation.
A read receipt can carry a sequence number meaning read up to here, so one receipt covers all earlier messages and a lost one is fixed by the next. Store only the highest number per user per conversation, and batch the writes.
Sources
- Leslie Lamport (1978). Time, clocks, and the ordering of events in a distributed system.