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.
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
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
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.