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 ensures memos are never lost — even in subways, airplanes, or any offline environment.
Outbox Architecture is a message delivery guarantee 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 both data loss during network failures and duplicate sends. 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. After successful delivery, Outbox data is immediately and permanently deleted. Users never even notice the Outbox exists — the "sent" UI appears instantly when the send button is tapped, while actual delivery happens asynchronously in the background.
Example: Sending a Memo on the Subway
1. On the subway, type an idea and tap send
2. The app shows "Sent" immediately (from the user's perspective, it's done)
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 — NWPathMonitor detects connectivity
5. The memo is retrieved from the Outbox, decrypted, and sent to Cloudflare Workers API
6. Resend API delivers to the recipient email address — success response confirmed
7. Encrypted Outbox data is permanently deleted
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 ensures no data loss during network failures and guarantees delivery upon reconnection.
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. iOS background tasks detect when connectivity returns, then memos are decrypted, sent via Cloudflare Workers + Resend API, and deleted from the Outbox upon success.
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
- Transactional Outbox Pattern — Microsoft Learn
- Outbox Pattern — Wikipedia