用語集 — 技術Glossary — Technology

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からメッセージを削除します。これにより「ネットワーク障害時のデータ損失」と「重複送信」の両方を防止します。モバイルアプリではオフラインファースト設計の基盤技術です。

Definition

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

ローカル永続化Local Persistence
メモはまずデバイス上のストレージに保存されます。ネットワークの状態に関係なく、ユーザーの操作は即座に完了します。シンプルメモではAES-256-GCMで暗号化して保存します。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.
バックグラウンド監視Background Monitoring
iOSのバックグラウンドタスクとNWPathMonitor(ネットワーク状態監視API)を使用して、接続回復を自動検出します。ユーザーがアプリを閉じていても、OSレベルで監視が続きます。iOS background tasks and NWPathMonitor (network state monitoring API) automatically detect connectivity restoration. Monitoring continues at the OS level even when the app is closed.
確認付き削除Confirmed Deletion
Cloudflare Workers + Resend APIからの送信成功レスポンスを確認した後にのみ、OutboxからメモデータをDelete します。APIエラー時はリトライし、メモが消失することはありません。Outbox data is deleted only after receiving a successful delivery response from Cloudflare Workers + Resend API. On API errors, the system retries — memos are never lost.

シンプルメモの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の暗号化データを完全削除

Scenario

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.

参考文献・外部リンク

References

オフラインでもメモは絶対に失わないNever Lose a Memo, Even Offline
Outboxアーキテクチャ+AES-256-GCM暗号化で、地下鉄でも機内でもメモが確実に届きます。7日間の無料トライアル付き。Outbox architecture + AES-256-GCM encryption ensures your memos are delivered reliably — subway, airplane, anywhere. 7-day free trial included.
App Store からダウンロード Download on the App Store

関連ページRelated Pages