Glossary — Technology

What is Outbox Architecture?

Outbox Architecture (Outbox Pattern) is a design pattern that queues messages locally and automatically sends them when network connectivity is restored. In Simple Memo, this keeps memos on the device until they can be sent — even in subways, airplanes, or any offline environment.

Definition

Outbox Architecture is a reliable-messaging pattern used in distributed systems. The sender first persists messages in a local Outbox, and a background process monitors the Outbox to send messages when network connectivity is available. After confirming successful delivery, messages are removed from the Outbox. This prevents data loss during network failures. A message whose success response was lost gets sent again, so preventing duplicates takes duplicate protection on the receiving side, such as an idempotency key. Simple Memo passes each memo's message ID to the email service as an idempotency key, which prevents duplicates within 24 hours. In mobile apps, it forms the foundation of offline-first design.

Three Components of the Outbox Pattern

Local Persistence
Memos are first saved to on-device storage regardless of network state, so user actions complete instantly. Simple Memo encrypts stored memos with AES-256-GCM.
Resend When the Connection Returns
While the app is running, NWPathMonitor (the network-state API) detects when the connection returns and resends. While the app is closed, resending is attempted when iOS runs the app's background refresh (iOS decides when) or the next time you open the app.
Confirmed Deletion
A memo is removed from the Outbox only after our Relay API (Cloudflare Workers) returns a success response. On errors it is retried automatically (up to 5 times per memo; a memo that stops can be resent manually from the history screen).

Simple Memo's Outbox Implementation

Simple Memo's Outbox goes beyond a simple offline queue — it balances security and UX. Memos are AES-256-GCM encrypted on save and decrypted only for transmission. Once a memo has been sent, it is removed from the Outbox. If you tap send while offline, the app shows "Offline - will send when connected" and keeps the memo in the Outbox.

Example: Sending a Memo on the Subway

Scenario

1. On the subway, type an idea and tap send

2. The app shows "Offline - will send when connected" (the memo waits on the device)

3. Behind the scenes, the memo is AES-256-GCM encrypted and saved to the Outbox

4. You emerge above ground and connect to LTE/Wi-Fi — if the app is running, NWPathMonitor detects the connection (if it is closed, iOS background refresh or the next app launch picks it up)

5. The memo is retrieved from the Outbox, decrypted, and sent to Cloudflare Workers API

6. Resend API accepts the email and the Relay API returns a success response (this does not confirm arrival in the inbox)

7. The memo is removed from the Outbox

FAQ: Outbox Architecture

What is the Outbox architecture pattern?

A design pattern that stores messages in a local queue and automatically sends them when connectivity is available. It keeps messages through network failures and sends them when the connection returns.

How does Simple Memo's Outbox work?

When a memo is sent without connectivity, it is AES-256-GCM encrypted and saved to the Outbox. When the connection returns, it is sent via Cloudflare Workers + Resend API — right away if the app is running, otherwise when iOS runs the app's background refresh or the next time you open the app — and removed from the Outbox once the send succeeds.

Are memos in the Outbox secure?

The Outbox stored on your device is encrypted with AES-256-GCM. Its key is stored in iOS Keychain and read by the app for encryption and decryption. The key is configured not to migrate to another device. Email delivery is not end-to-end encrypted. Read the backup and key management details.

References

Keep Writing Memos, Even Offline
Outbox architecture + AES-256-GCM encryption keeps memos queued on your device while offline — subway, airplane — and sends them when the connection returns. Free to download.
Download on the App Store

Related Pages