Facebook Messenger System Design

Lesson 161 of 25610 min readPremium lesson preview
In this lesson2 sections

Facebook Messenger System Design

Interview exercise

Design a Messenger-like service for direct and group conversations with text, attachments, delivery receipts, and several devices per account. Treat this as a hypothetical product. Build on the preceding messaging design, but make the behavior of a reconnecting device precise.

Use about 60 minutes: spend the first ten clarifying semantics and scale, twenty on the message and media paths, twenty on failure cases, and the remainder evaluating the design. The questions below can guide a self-review or a practice session with another person.

Define the delivery contract

Start by separating server acceptance, device delivery, and read receipts. Decide whether “delivered” means at least one recipient device or every currently registered device. For a group, state whether the interface shows an aggregate or per-member receipt. A device that was removed from an account should not remain a delivery target indefinitely.

Specify the offline retention window and what the client displays when a pending message expires. Choose an ordering rule within each conversation, including concurrent sends from different devices. Avoid promising a single order across unrelated conversations unless a requirement needs it.

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.