Misplaced Pages

Inbox and outbox pattern

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Patterns for database applications
This article is an orphan, as no other articles link to it. Please introduce links to this page from related articles; try the Find link tool for suggestions. (April 2023)

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 an inbox table in a database. Once the data has been persisted another application, process or service can read from the inbox table and use the data to perform an operation which it can 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.

Illustration of an inbox table.

The outbox pattern

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

Illustration of the outbox pattern.

Illustration of an outbox table.

See also

External links

Category: