OutboxアーキテクチャとはWhat is Outbox Architecture?
Outboxアーキテクチャ(Outboxパターン)は、メッセージをローカルにキューイングし、ネットワーク接続が回復した時点で自動送信する設計パターンです。Captio式シンプルメモでは、この仕組みにより地下鉄や機内などオフライン環境でもメモが失われません。 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アーキテクチャは、分散システムにおけるメッセージ配信保証パターンです。送信者はメッセージをまずローカルのOutbox(送信箱)に永続化し、バックグラウンドプロセスがOutboxを監視して、ネットワーク接続時に順次送信します。送信成功を確認後、Outboxからメッセージを削除します。これにより「ネットワーク障害時のデータ損失」と「重複送信」の両方を防止します。モバイルアプリではオフラインファースト設計の基盤技術です。
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.
Outboxパターンの3つの要素Three Components of the Outbox Pattern
シンプルメモのOutbox実装Simple Memo's Outbox Implementation
Captio式シンプルメモのOutboxは、単なるオフラインキューではなく、セキュリティとUXを両立させた設計です。メモの保存時にAES-256-GCMで暗号化し、送信時にのみ復号。送信完了後はOutboxデータを即座に完全削除します。ユーザーにはOutboxの存在すら意識させません。送信ボタンを押した瞬間に「送信完了」UIを表示し、実際の送信はバックグラウンドで非同期に行います。 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. 地下鉄の車内でアイデアをメモに入力し、送信ボタンをタップ
2. アプリは「送信完了」を表示(ユーザー体験としては即完了)
3. 裏側ではメモをAES-256-GCMで暗号化してOutboxに保存
4. 地上に出てLTE/Wi-Fiに接続 → NWPathMonitorが接続を検出
5. Outboxからメモを取り出し、復号してCloudflare Workers APIに送信
6. Resend APIが受信者メールアドレスへ配信 → 成功レスポンスを確認
7. Outboxの暗号化データを完全削除
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
よくある質問(Outboxアーキテクチャ)FAQ: Outbox Architecture
Outboxアーキテクチャとは何ですか?
メッセージをローカルのキュー(送信箱)に保存し、ネットワーク接続時に自動送信する設計パターンです。オフライン環境でもデータを失わず、接続回復時に確実にデータを届けます。
シンプルメモのOutboxはどう動きますか?
メモ送信時にネットワークが利用できない場合、AES-256-GCMで暗号化してOutboxに保存。接続回復を自動検出し、Cloudflare Workers経由でResend APIに送信。送信完了後にOutboxデータを削除します。
Outboxのメモは安全ですか?
はい。すべてAES-256-GCM暗号化されます。暗号鍵はiOSのKeychain(Secure Enclave)に保管され、デバイス外に送信されません。
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?
Yes. All memos are AES-256-GCM encrypted. The encryption key stays in the iOS Keychain (Secure Enclave) and never leaves the device.