Modern distributed applications need distinct guarantees: determinism, instant replay, and speculative branching. useEventStack is the code-first runtime that turns arbitrary application logic into durable, verifiable, reversible execution DAGs without workflow DSL lock-in.
/With English narration, subtitles, audio descriptions, and chapters included.
60-second tour
00:00Intro — Choose how it executes
00:10The problem
00:20Execution is a policy
00:30Fork 3 arms, commit 1
00:40Kill it mid-write
00:50Try it — cargo test
The same chapters are embedded in the player.
Multi-Runtime Quick Install
Install the useEventStack runtime kernel in your preferred environment:
$curl -fsSL https://get.useeventstack.dev | sh
SHA256: 7f8b9e4a... [Verified]
Section 01 // The Problem
Modern applications require distinct execution guarantees, but current tooling forces anti-patterns.
Building reliable systems today means choosing between brittle ad-hoc glue code, bloated black-box workflow orchestrators, or massive vendor-locked cloud state machines.
warning
Distributed Failure Modes
Partial network partitions, split-brain payments, and third-party rate limits leave microservices in inconsistent zombie states. Developers end up hand-coding retry loops that exacerbate cascading stampedes.
close State drifting across DB + Queues
lock
Workflow Engine Lock-In
Traditional orchestrators require heavy proprietary servers, specialized JSON/YAML DSLs, and invasive decorators that completely contaminate your core business domain models.
close Heavy background worker overhead
psychology_alt
Unpredictable AI & API Latency
Modern pipelines combine LLMs, external APIs, and local state. When an LLM takes 4 seconds or times out, you cannot afford to restart from scratch or leave users waiting without fallback speculation.
close Inability to branch speculative paths
Section 02 // The Core Idea
Execution should be configurable. Decouple business logic from runtime mechanics.
In useEventStack, your code defines what happens. You attach execution semantics as pure composable policies. The runtime handles idempotency, state persistence, replay journals, and speculative resolution.
Layer 01
Application Code
Pure async functions, business entities, and domain handlers. Zero orchestration bloat.
Lightweight embedded engine (<4MB memory). Checkpoint journal and DAG scheduler.
Local / MicroVM / Node Process
Layer 04
Any Infrastructure
Postgres, Redis, FoundationDB, S3, or Edge KV. Bring your existing persistence layer.
Pluggable Storage SPI
Section 03 // Code-First Philosophy
Write code. Not workflows.
You don't need drag-and-drop workflow canvases or JSON diagrams to achieve high reliability. With useEventStack, write idiomatic code in native languages. Every call chain is recorded to a deterministic Merkle state tree.
check_circle No proprietary language or workflow visualizer mandatory
check_circle Type-safe input, output, and failure contracts with Zod/Serde
check_circle Deterministic step execution with zero side-effect leakage
Select the optimal strategy per operation, or combine them in a single workflow pipeline.
DETERMINISTIC
Deterministic Execution
Every step input, side-effect output, and timer is recorded to an append-only journal. Re-executing produces bit-for-bit identical state every time.
• Guarantees: Exactly-once state mutation
• Recovery: Instant crash recovery
• Overhead: < 0.3ms journal append
REPLAY SEMANTICS
Time-Travel Replay
Reconstruct any historical system state by replaying journals. Debug production bugs locally by injecting real production event traces into your local simulator.
• Guarantees: Zero-drift state recovery
• Testability: Offline production re-runs
• Auditing: Cryptographic Merkle logs
SPECULATIVE
Speculative Branching
Spawn parallel execution hypotheses concurrently. Discard failed or slow branches with zero journal pollution while committing the winning result atomically.
• Guarantees: Tail latency hedge (P99 hedge)
• Isolation: Sandboxed temporary journals
• Rollback: Pure O(1) pointer swap
Section 05 // Speculative Execution
When one path is not enough: Speculative Execution
Distributed systems face latency spikes, unpredictable AI agent outputs, and flaky external APIs. Instead of waiting sequentially, execute multiple hypotheses in isolated temporary sandboxes.
Speculation Resolution Pipeline— trace #402
WAL #402/WINNER: A (2ms)/DRIFT: 0B
01 // INGESTSEALED
Incoming Trigger
Pre-branch state baseline
SNAPSHOTWAL #402
↓ FORK 3 ARMS
BRANCH ACached Embedding
stale-tolerant
COMMITTED~2 ms
BRANCH BReal-time LLM Call
highest fidelity
TIMED OUT~4 s
BRANCH CRule Heuristic
deterministic floor
SUPERSEDED0.3 ms
↓ RESOLVE
03 // ATOMICPROMOTED
Promote to Trunk
O(1) pointer swap
JOURNAL DRIFT0 BYTES
Section 06 // Universal Footprint
Your infrastructure. Your choice.
useEventStack doesn't demand Kubernetes or a managed SaaS orchestrator. The runtime compiles down to native machine code or WebAssembly and runs anywhere computing happens.
cloud
Cloud Native (AWS, GCP, Azure)Deploy as long-running pods or serverless functions with fast cold-starts (<12ms).
dns
Edge Workers (Cloudflare, Fastly, Deno)Embedded Wasm execution at 28 global edge PoPs with local memory journal.
hard_drive
Self-Hosted Bare Metal & On-PremComplete offline air-gapped support with zero outbound telemetry dependencies.
Infrastructure Compatibility Matrix
Environment
Binary Size
Cold Start
Persistence SPI
Node.js / Bun
3.4 MB
8 ms
Postgres / Redis / FS
Rust Native
2.1 MB
0.8 ms
RocksDB / SQLite / S3
Wasm Edge
1.2 MB
1.4 ms
KV Storage / Durable Objects
Docker Container
18 MB (Scratch)
22 ms
Any JDBC / Raft Store
Section 07 // Architecture Flexibility
No forced workflow model. Fits your current stack.
useEventStack doesn't require rewriting your existing backend services. It embeds directly inside your microservices, APIs, background queues, or event routers.
Event-Driven Kafka/SQS
Wraps consumer handlers with automatic step checkpointing. Never double-process a duplicate message.
B2B Integration Pipelines
Handle brittle 3rd-party webhooks with automatic exponential replay and zero state loss.
Transactional Outbox
Guarantees that database writes and outgoing network events commit atomically.
AI Agent Orchestration
Checkpoint multi-step tool calls and branch alternate agent prompts speculatively.
Section 08 // Wire-to-Storage Architecture
Inside the Execution Engine
Comprehensive wire-to-storage breakdown of the useEventStack kernel. Pure deterministic contracts between the user application and storage drivers.
Ingestion
SDKs & Transports
gRPC / HTTP / Kafka / SQS. Ingests raw event and assigns logical clock timestamp.
Isolation
Effect Boundary
Sandboxes side-effects. Intercepts random seeds, clocks, and external I/O.
Core engine
Deterministic Kernel
Merkle State DAG, Speculation Switcher, Replay Controller, Outbox Manager.
Journaling
Durable State SPI
Zero-loss WAL journal. Snapshot intervals with atomic pointer swap.
Targets
External Systems
Databases, external APIs, and pub/sub queues receive committed mutations.
Deterministic Guarantees:
TLA+ Verified Invariants (Zero state divergence)
Storage Driver Protocol:
Pluggable SPI (PostgreSQL, SQLite, S3, RocksDB)
Telemetry Export:
OpenTelemetry native span injection with trace parent
Section 09 // Developer Experience Flow
From zero to production-grade resilience in 7 clear steps
01 // Install
Add Dependency
Run npm i @eventstack/core or cargo add use-event-stack. No external server daemon required.
02 // Define
Declare Execution Semantics
Assign execution strategies (replayable, speculative, deterministic) to functions via declarative type-safe builders.
03 // Simulate
Test Network Failures Locally
Use the embedded test simulator to inject packet drops, timeouts, and process kill signals without leaving localhost.
04 // Recover
Replay Production Traces
Export encrypted production journal traces and step through execution locally in VS Code with full breakpoint support.
Section 10 // Formal Correctness & Verification
Engineered for correctness. Zero marketing hype.
Execution infrastructure cannot fail silently. We subject useEventStack to rigorous formal verification, chaos injection, and Jepsen test suites.
TLA+ Specification
Formally Verified Protocols
The Merkle replay kernel and speculative rollback algorithms are verified against state-space explosion using TLC Model Checker.
Jepsen Audited
Partition & Split-Brain Tested
Verified under continuous network drops, process kills (kill -9), and storage disk fsync failures without silent corruption.
Deterministic Clocks
Virtual Time Virtualization
Clocks, timeouts, and sleep durations are virtualized into logical ticks, enabling 10-hour timeouts to be tested in 2 milliseconds.
Section 11 // Target Personas
Built for engineers who care about how their code runs
01
Platform Engineers
Standardize company-wide resilience without mandating heavy proprietary clusters.
02
Backend Engineers
Replace spaghetti retry logic and brittle cron jobs with durable deterministic pipelines.
03
Integration Engineers
Ingest flaky webhooks and sync partner ERP systems with zero transaction drop.
04
Staff Engineers
Establish verifiable system invariants with audit-ready cryptographic journals.
05
Engineering Leaders
Drastically reduce cloud spend and operational incidents while avoiding orchestrator lock-in.
Section 12 // Real-World Production Use Cases
Proven in high-stakes production environments
Financial commerce
Multi-Gateway Payment Routing
Speculatively execute primary and secondary payment authorization paths to hedge against payment gateway brownouts, reducing checkout drop-offs by 4.2%.
Data pipelines
Zero-Loss CDC ETL Pipelines
Stream database changes through deterministic transformation pipelines. When downstream destination DBs crash, resume exactly at the committed Merkle offset.
AI agent platforms
Multi-Model Agent Tooling
Branch queries concurrently across local small language models and cloud frontier models. Commit the first response that passes deterministic validation schema.
Section 13 // Open Source & Research
Built openly. Designed around engineering principles.
We publish our architectural RFCs, formal TLA+ proofs, and engine specifications openly for community critique and peer review.
RFC-0081
Virtual Timers & Deterministic Clocks
Specifies clock mocking and monotonic tick incrementing across asynchronous distributed runtimes.
Short, direct answers — the same text search and AI engines cite.
What is useEventStack?
useEventStack is a code-first execution runtime that turns ordinary application logic into durable, verifiable, reversible execution DAGs. You write native TypeScript, Rust, or Go — the runtime adds determinism, instant replay, and speculative branching without a workflow DSL or orchestrator lock-in.
How is useEventStack different from Temporal or workflow engines?
Workflow engines require proprietary servers, JSON or YAML DSLs, and decorators that invade your domain code. useEventStack embeds inside your existing services as a lightweight runtime under 4MB, keeps your code idiomatic, and makes execution semantics — deterministic, replayable, speculative — a per-step configuration instead of a platform migration.
What are the three execution strategies?
Deterministic execution records every step to an append-only journal for bit-for-bit reproducible state. Time-travel replay reconstructs any historical state for debugging and audits. Speculative branching runs parallel execution hypotheses and commits the winner atomically, discarding slow or failed paths with zero journal pollution.
How does speculative branching work?
When a trigger arrives, the runtime snapshots state and executes multiple hypotheses — for example a cached embedding, a live LLM call, and a rules heuristic — in isolated sandboxes. An evaluator picks the winner, which commits atomically while losers roll back with a pure O(1) pointer swap.
Where does useEventStack run?
Anywhere computing happens: cloud pods and serverless functions with sub-12ms cold starts, WebAssembly edge workers across 28 global PoPs, or self-hosted bare metal with full air-gapped support. Persistence is pluggable — Postgres, Redis, RocksDB, SQLite, S3, or edge KV.
What performance and reliability figures does it target?
A 1.18ms p99 journal sync with zero dropped writes, an 8ms cold start on Node.js and 0.8ms on native Rust, and a 99.999% determinism SLA backed by TLA+-verified invariants and Jepsen-tested partition recovery.
How do I start building?
One command — curl -fsSL https://get.useeventstack.dev | sh — or install for Cargo, npm, Homebrew, or Docker. The runtime is open source under Apache-2.0 and MIT, and the multi-runtime quick-install on this page gets you running in about 60 seconds.
READY FOR ENTERPRISE WORKLOADS
Build systems that keep running when reality breaks.
Eliminate zombie states, avoid orchestrator lock-in, and gain full determinism across all your services.
$curl -fsSL https://get.useeventstack.dev | sh
Apache-2.0 & MIT Dual License • Open Source Runtime