Edge / WebAssembly ランドスケープ

Edge Computing と WebAssembly エコシステムの全体構成を俯瞰するマップ。各ノートがどのレイヤーに属し、何と何が接続するかを示す。

全体アーキテクチャ

graph TB
    subgraph User["ユーザー / クライアント"]
        Browser["ブラウザ / モバイル"]
    end

    subgraph Network["ネットワーク層"]
        QUIC["QUIC / HTTP/3<br/>トランスポート"]
        Anycast["Anycast / CDN<br/>ルーティング + キャッシュ"]
    end

    subgraph Edge["Edge 実行層"]
        V8["V8 Isolates<br/>JS/TS ランタイム"]
        WasmE["WASM at the Edge<br/>WASM ランタイム"]
    end

    subgraph Impl["ランタイム実装"]
        WT["Wasmtime<br/>リファレンスランタイム"]
    end

    subgraph Spec["仕様 / 標準"]
        CM["Component Model<br/>コンポーネント合成"]
        WS["WASI<br/>システムインターフェース"]
        WTC["WinterTC<br/>JS API 標準化"]
    end

    subgraph Data["データ層"]
        ED["Edge データストア<br/>KV / DO / D1 / R2"]
    end

    subgraph Org["組織"]
        BA["Bytecode Alliance<br/>実装団体"]
    end

    Browser --> QUIC --> Anycast --> Edge
    V8 --> WTC
    WasmE --> WT --> CM --> WS
    BA --> WT
    BA --> CM
    Edge --> Data

レイヤー構成

graph TB
    subgraph App["アプリケーション層"]
        Patterns["設計パターン<br/>Middleware / SSR / A-B テスト / API Gateway"]
    end

    subgraph Platform["プラットフォーム層"]
        Platforms["Cloudflare Workers / Deno Deploy / Fastly Compute"]
    end

    subgraph Runtime["ランタイム層"]
        JS_RT["JS ランタイム<br/>V8 Isolates<br/>workerd / Deno"]
        WASM_RT["WASM ランタイム<br/>Wasmtime / Wasmer / WasmEdge"]
    end

    subgraph SpecLayer["仕様 / 標準層"]
        JS_Spec["JS API 標準<br/>WinterTC ECMA-429"]
        WASM_Spec["Component Model<br/>合成の型システム"]
        WASI_Spec["WASI<br/>システム API"]
    end

    subgraph DataLayer["データ層"]
        DataStore["KV / Durable Objects / D1 / R2 / Queues<br/>CAP / CRDT / 一貫性モデル"]
    end

    subgraph Net["ネットワーク層"]
        Network["Anycast + BGP で最寄り PoP<br/>QUIC / HTTP/3 で 0-RTT"]
    end

    subgraph Sec["セキュリティ層"]
        Security["DDoS / WAF / TLS 終端 / Zero Trust / Bot"]
    end

    subgraph Foundation["判断フレームワーク"]
        Decide["Edge Computing とは<br/>Edge vs Cloud vs On-premise"]
    end

    App --> Platform
    Platform --> Runtime
    JS_RT --> JS_Spec
    WASM_RT --> WASM_Spec --> WASI_Spec
    Runtime --> DataLayer
    DataLayer --> Net
    Net --> Sec
    Sec --> Foundation

WASM 仕様の階層

Component Model がどこに位置するかを明確にする。

graph BT
    Core["Core WebAssembly Spec<br/>バイトコード, 線形メモリ, 数値型のみ<br/>W3C Standard"]
    CM["Component Model<br/>WIT + Canonical ABI + Share-Nothing<br/>Core Module を型安全に結合<br/>W3C Proposal"]
    WASI["WASI<br/>wasi:http, wasi:filesystem, wasi:sockets 等<br/>Component Model の上に定義された API 群<br/>W3C WASI Subgroup"]
    App["アプリケーション<br/>Edge ハンドラ, プラグイン, マイクロサービス"]

    Core --> CM
    CM --> WASI
    WASI --> App
層何を定義するか誰が策定状態
Core Wasmバイトコード、線形メモリ、4つの数値型W3CStandard (3.0, 2025年9月)
component-modelWIT (IDL) + Canonical ABI + メモリ隔離。Core Module を型安全に結合W3C Proposal実装済 (Wasmtime)、標準化途中
wasiComponent Model 上のシステム API (http, fs, sockets 等)W3C WASI SubgroupP2 安定、P3 RC、1.0 は 2026末-2027

ポイント: Component Model は WASI ではない。WASI は Component Model の「ユーザー」。Component Model はプラグインシステムや多言語ライブラリ共有にも WASI なしで使える。

標準化組織の役割分担

graph LR
    W3C["W3C WebAssembly CG<br/>何を標準にするか<br/>Core Wasm / Component Model / WASI"]
    BA["Bytecode Alliance<br/>どう実装するか<br/>Wasmtime / Cranelift / cargo-component"]
    WTC["Ecma TC55 WinterTC<br/>JS ランタイム間の API 標準化<br/>ECMA-429"]
    CNCF["CNCF<br/>クラウドネイティブプロジェクト<br/>SpinKube / wasmCloud"]

    W3C -->|"仕様"| BA
    BA -->|"実装フィードバック"| W3C
    WTC -.->|"補完関係"| BA
    BA -->|"プロジェクト寄贈"| CNCF

JS ランタイム vs WASM ランタイム

graph TB
    subgraph JS["JS ランタイム (V8 ベース)"]
        CF["Cloudflare Workers<br/>workerd / 335+ PoP"]
        Deno["Deno Deploy<br/>6 リージョン"]
        Vercel["Vercel Edge<br/>126 PoP"]
    end

    subgraph WR["WASM ランタイム"]
        Fastly["Fastly Compute<br/>Wasmtime / ~80 PoP"]
        Spin["Fermyon Spin Akamai<br/>Wasmtime / 4100+ PoP"]
    end

    subgraph Hybrid["ハイブリッド"]
        CFW["Cloudflare Workers<br/>V8 内で WASM も実行<br/>34% が WASM 含む"]
    end

    JS ---|"WinterTC で API 標準化"| JS
    WR ---|"WASI + Component Model で標準化"| WR

データフロー: リクエストの旅

sequenceDiagram
    participant User as ユーザー (東京)
    participant DNS as DNS
    participant BGP as BGP Anycast
    participant PoP as 東京 PoP
    participant Worker as Edge Worker
    participant Store as Edge Store
    participant Origin as Origin

    User->>DNS: DNS クエリ
    DNS-->>User: Anycast IP
    User->>BGP: HTTPS (QUIC/H3)
    BGP->>PoP: 最寄り PoP にルーティング
    PoP->>PoP: TLS 終端
    PoP->>PoP: キャッシュ確認
    alt キャッシュヒット
        PoP-->>User: 即応答 (< 10ms)
    else キャッシュミス
        PoP->>Worker: V8 Isolate or WASM 実行
        Worker->>Store: KV / D1 / DO アクセス
        Store-->>Worker: データ
        alt Origin 不要
            Worker-->>PoP: Edge で処理完結
        else Origin 必要
            Worker->>Origin: fetch (Neon/外部 DB)
            Origin-->>Worker: レスポンス
        end
        PoP-->>User: レスポンス
    end

Almide → Edge パイプライン

graph LR
    Almide["*.almd<br/>Almide ソース"]
    Rust["*.rs<br/>Rust コード"]
    Component["*.wasm<br/>Component"]
    Edge["Edge デプロイ"]

    Almide -->|"Almide コンパイラ"| Rust
    Rust -->|"cargo-component<br/>wasm32-wasip2"| Component
    Component -->|"spin deploy<br/>fastly compute deploy"| Edge

    WIT["WIT 定義<br/>wasi:http/incoming-handler"]
    WIT -.-> Component

    DCE["DCE<br/>wasm-opt -Oz"]
    DCE -.->|"バイナリサイズ → Cold Start"| Component

    RI["Region Inference<br/>+ Perceus"]
    RI -.->|"GC なしメモリ管理"| Rust

メモリ管理戦略の位置づけ

graph LR
    subgraph Static["コンパイル時決定"]
        Rust_OW["Rust 所有権"]
        RI["Region Inference<br/>リージョン単位一括解放"]
    end

    subgraph RT["実行時決定"]
        Perceus_RC["Perceus<br/>RC + reuse (alloc/free ゼロ)"]
        GC["GC<br/>tracing, generational"]
    end

    subgraph HM["ハイブリッド"]
        Bump["Bump Allocator<br/>+ リージョンスコープ<br/>Almide の現在の実装"]
    end

    Rust_OW -.->|"影響"| RI
    RI -.->|"理論的基盤"| Bump
    Perceus_RC -.->|"reuse の精神"| Bump

ノート間の関連マップ

ノート属するレイヤー主な接続先
edge-computing概念全ノートの起点
edge-vs-cloud-vs-onprem判断edge-computing
v8-isolatesランタイムedge-platforms, wintertc
wasm-at-the-edgeランタイムwasmtime, wasi, component-model
wasmtimeランタイム実装wasi, component-model, bytecode-alliance
component-model仕様wasi (上位), Core Wasm (下位), wasmtime (実装)
wasi仕様component-model (基盤), wasmtime (実装), wasm-at-the-edge (利用)
wintertc仕様v8-isolates, edge-platforms
bytecode-alliance組織wasmtime, wasi, component-model
edge-platformsプラットフォームv8-isolates, wasm-at-the-edge, edge-data
edge-dataデータdistributed-consistency, edge-platforms
distributed-consistency理論edge-data
anycast-cdnネットワークquic-http3, edge-security
quic-http3プロトコルanycast-cdn
edge-securityセキュリティanycast-cdn, v8-isolates
edge-design-patternsパターンedge-platforms, edge-data
dead-code-eliminationコンパイラwasm-at-the-edge (バイナリサイズ → Cold Start)
region-inferenceメモリ管理perceus, wasm-at-the-edge
perceusメモリ管理region-inference, rust

WebAssembly 用語集

この文脈で出てくる主要な用語と、vault 内のどこに詳細があるかの索引。

仕様・標準

用語説明詳細
Core WasmWebAssembly のバイトコード仕様。線形メモリ、4つの数値型 (i32/i64/f32/f64)。W3C Standard (3.0)—
Component ModelCore Module を型安全に結合する仕様。WIT + Canonical ABI + Share-Nothing Linkingcomponent-model
WIT (WebAssembly Interface Types)Component Model の IDL。package/interface/world でコンポーネントの契約を定義。record, variant, enum, flags, resource 等の型システムcomponent-model の「WIT」セクション
Canonical ABIWIT の高水準型 (string, record 等) と Core Wasm の低水準表現 (i32 + 線形メモリ) の変換規則。lift (低→高) / lower (高→低)component-model の「Canonical ABI」セクション
WASI (WebAssembly System Interface)Component Model の上に定義されたシステム API 群 (http, filesystem, sockets 等)。Capability-based securitywasi
WASI Preview 145個のフラット C ABI 関数。ネットワーキングなし。レガシー。Rust ターゲット: wasm32-wasip1wasi
WASI Preview 2 (0.2)Component Model ベース。WIT で定義。wasi:http, wasi:sockets 追加。2024年1月安定版。Rust ターゲット: wasm32-wasip2wasi
WASI Preview 3 (0.3)native async (stream/future)。2026年 RC。WASI 1.0 への途上wasi
WasmGCWebAssembly 3.0 の一部。GC 言語 (Java, Kotlin, Dart) をネイティブコンパイル可能に。ブラウザ対応済、サーバーサイドは限定的—
SIMD (128-bit)WebAssembly 2.0 の一部。v128 型で 16レーン同時演算。SSE2/NEON の共通部分集合wasm-simd
Relaxed SIMDSIMD の決定性要件を緩和。FMA, dot product 等。WebAssembly 3.0relaxed-simd

ツールチェーン

用語説明詳細
cargo-componentRust で WASM Component をビルドする Cargo サブコマンドcomponent-model
wit-bindgenWIT からゲスト言語バインディングを自動生成。Rust, C, Go 等に対応component-model
WAC (WebAssembly Composition)複数コンポーネントを合成するツール。wac plug で未解決 import を依存の export で充足component-model の「コンポーネントの合成」セクション
wasm-toolsWASM モジュールの低レベル操作 CLI。wasm-tools component wit で WIT 検査、component new で Core → Component 変換component-model
wasm-opt (Binaryen)WASM バイナリの最適化ツール。-Oz でサイズ最適化。DCE を含むdead-code-elimination
wasm-pkg-tools (wkg)OCI / Warg レジストリへのコンポーネント publish/fetchcomponent-model
ComponentizeJSESM (JavaScript) → WASM Component 変換。SpiderMonkey 埋め込みcomponent-model
componentize-pyPython → WASM Component 変換component-model
jcoJavaScript 用 Component Model ツールチェーン。トランスパイル + 実行component-model
JavyJavaScript → WASM 変換 (QuickJS 埋め込み)bytecode-alliance

ランタイム

用語説明詳細
WasmtimeBytecode Alliance のリファレンスランタイム。WASI P2 / Component Model の世界初完全実装wasmtime
CraneliftWasmtime 内のコンパイラバックエンド。SSA IR, aegraph 最適化, ISLE DSLwasmtime の「Cranelift」セクション
WinchWasmtime 内のベースラインコンパイラ。シングルパスで高速コンパイル。Cold start 最小化用wasmtime
Pooling AllocatorWasmtime の事前確保メモリプール。malloc なしのインスタンス化。CoW メモリイメージwasmtime
Wasmer代替ランタイム。WASIX (独自 POSIX 拡張) に注力。ロックインリスクwasmtime の比較セクション
WasmEdgeCNCF Sandbox。Edge AI 特化 (WASI-NN, TensorFlow Lite)。最小メモリwasmtime の比較セクション
WAMR組み込み/IoT 向け超軽量ランタイム (インタプリタ)bytecode-alliance
V8Google の JS/WASM エンジン。Chrome/Node.js/Deno/Cloudflare Workers の基盤。Component Model 非対応v8-isolates
workerdCloudflare Workers の OSS ランタイム。V8 ベースv8-isolates

プラットフォーム

用語説明詳細
Cloudflare WorkersV8 Isolates ベース。335+ PoP。D1/R2/KV/DO の統合エコシステムedge-platforms
Fastly ComputeWASM-native (Wasmtime)。~80 PoP。per-request isolationedge-platforms
Fermyon SpinComponent Model ベースの WASM FaaS。Akamai が買収。CNCFedge-platforms
SpinKubeKubernetes 上で Spin アプリを実行。CNCF Sandboxwasm-at-the-edge
Deno DeployV8 Isolates (Deno 2.0)。6 リージョン。TypeScript ファーストedge-platforms
wasmCloudCNCF Incubating。NATS バックボーンの分散 WASM ランタイムwasm-at-the-edge

Component Model の概念

用語説明詳細
worldコンポーネントの完全な契約。import (必要なもの) と export (提供するもの) のセットcomponent-model
interface型と関数の名前付きコレクション。world 内で import/export されるcomponent-model
packagenamespace:name@version。同一ディレクトリの全 .wit が1パッケージcomponent-model
resourceコンポーネント外部エンティティへの偽造不可能なハンドル。own (所有) / borrow (借用)component-model
Share-Nothing Linkingコンポーネントはメモリを export できない。データ交換は Canonical ABI でのコピーのみcomponent-model
lift / lowerlift: Core Wasm → Component (低→高)。lower: Component → Core Wasm (高→低)component-model
cabi_reallocflat 化上限 (パラメータ16個, 結果1個) を超えた場合にメモリ確保する関数component-model
reuse tokenperceus の概念。RC==1 のオブジェクトのメモリを同サイズの新オブジェクトとして直接再利用perceus

WASI のインターフェース

用語説明状態
wasi:httpHTTP incoming/outgoing handlerPhase 3 (安定)
wasi:filesystemファイル/ディレクトリ操作 (capability-based)Phase 3
wasi:socketsTCP/UDP ソケットPhase 3
wasi:cliコマンドライン (args, env, stdio)Phase 3
wasi:ioストリーム、ポーリングPhase 3
wasi:clockswall-clock, monotonic-clockPhase 3
wasi:random暗号的安全乱数Phase 3
wasi:nnML 推論 (ONNX, TF Lite, GGML)Phase 2
wasi:keyvalueKV ストアPhase 1
wasi:sqlSQL データベースPhase 1
wasi:blob-storeオブジェクトストレージPhase 1
wasi:messagingメッセージング/Pub-SubPhase 1
wasi:threadsスレッドサポートPhase 1
WASIXWasmer 独自の POSIX 拡張 (fork, pthreads, BSD sockets)。公式 WASI 標準ではないWasmer 限定

ネットワーク / セキュリティ

用語説明詳細
Anycast同一 IP を複数拠点が BGP で広告。最寄り PoP にルーティングanycast-cdn
BGPAS 間の経路情報交換プロトコル。Anycast の基盤anycast-cdn
PoP (Point of Presence)CDN のエッジ拠点。キャッシュ + TLS 終端 + コンピュートanycast-cdn
QUICUDP 上の暗号化トランスポート。0-RTT, Connection ID によるコネクションマイグレーションquic-http3
HTTP/3HTTP over QUIC。HoL Blocking 解消。QPACK ヘッダ圧縮quic-http3
Origin ShieldCDN キャッシュ階層の L3。全リージョナルミスを集約し、Origin への同時リクエストを1つに結合anycast-cdn
TLS 終端PoP でクライアントとの TLS ハンドシェイクを終端。Origin への往復レイテンシ排除edge-security
WAFWeb Application Firewall。OWASP Top 10 対策。Edge で攻撃をブロックedge-security

組織

用語説明詳細
Bytecode AllianceWASM エコシステムの実装団体 (非営利)。Wasmtime, Cranelift, cargo-component 等bytecode-alliance
W3C WebAssembly CGWASM コア仕様・Component Model・WASI の策定bytecode-alliance の比較セクション
WinterTC (Ecma TC55)JS ランタイム間の Web API 標準化。ECMA-429wintertc
CNCFクラウドネイティブプロジェクトホスティング。SpinKube, wasmCloudwasm-at-the-edge

関連

全ノートへのリンクはこのノート自体がマップとして機能する。

Graph