Jump to content

Inbox and outbox pattern

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Frap (talk | contribs) at 13:38, 24 April 2023 (Initial article creation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The inbox pattern and outbox pattern are two related patterns used by applications to persist data (usually in a database) to be used for operations with guaranteed delivery.

The inbox and outbox concepts are used in the ActivityPub protocol and in email.

The inbox pattern

The application receives data which it persists to a inbox table. Once persisted another application, process or service can can read the inbox and use the data to do an operation and retry upon failure until completion, the operation may take a long time to complete. The inbox pattern ensures that a message was received (e.g. to a queue) successfully at least once.

Illustration of the inbox pattern.

The outbox pattern

The application persists data to a outbox table in a database. Once persisted another application or process can read from the outbox table and use that data to do an operation and retry upon failure until complete. The outbox pattern ensures that a message was sent (e.g. to a queue) successfully at least once.

Illustration of the outbox pattern.

See also