Why shared inboxes should store messages, not conversations, as the primary key
A common mistake in shared-inbox design is making a conversations table the source of truth, which forces risky merge logic that can lose data. The proposed model treats messages as immutable records keyed by their own ID, with contacts and threads derived from them. Threads are linked through an append-only table that records why each message was grouped, so wrong merges can be undone and threads rebuilt at any time. The article also covers identity matching, per-recipient delivery tracking for outbound mail, and a unique constraint on external IDs to prevent duplicate replies from webhook retries.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in