There is no reference documentation, no stable API, no NuGet package, and no support.
A microsecond-latency ACID data engine combining ECS archetype storage with tick-based parallel execution.
Typhon is an embedded data engine for real-time workloads like game servers, simulations, and stateful dataflow.
It pairs a microsecond-latency ACID store β MVCC snapshot isolation, configurable durability, source-generated ECS archetype accessors β with a tick-based parallel runtime that dispatches fine-grained system chunks across worker threads, each operating directly on the store.
The runtime doesn't sit on top of the database β it runs inside it.
π Start here:
- User Guide β learn the key concepts hands-on, backed by a small runnable sample project (
doc/guide/example). - In-Depth Overview β dig into how every subsystem works, and the reasoning behind it.
- Microsecond Operations β Optimized for Β΅s-level latency with pinned memory, SIMD, and lock-free reads
- ACID Transactions β Full transactional semantics with optimistic concurrency control
- MVCC Snapshot Isolation β Readers never block writers; each transaction sees a consistent snapshot
- ECS Archetype System β Entities are typed by archetype; components are blittable structs with source-generated accessors and archetype inheritance
- Larger-Than-RAM Storage β The database is a memory-mapped, paged file on disk, virtualized through a page cache that holds only the hot working set β so resident memory is bounded by the cache, not the database. Manipulate a 100 GiB store on a machine with a fraction of that RAM; component data, indexes, and the entity map all page to/from disk on demand (in-memory ECS frameworks, by contrast, must fit the entire world in RAM)
- Workbench Dev UI β A local, browser-based companion (ASP.NET Core + React/Vite) β DataGrip for Typhon, not just a profiler. Open a recorded
.typhon-trace, attach to a live engine over TCP, or open a.typhondatabase file directly. Performance: per-tick profiler timeline with CPU-sample + off-CPU overlays, Top Spans, Call Tree, Critical Path, System DAG. Data & schema: component/archetype browsers, Schema Inspector, a zoomable Hilbert-curve Database File Map, live Resource Tree. Queries: catalog, plan tree, per-execution inspector β all in a dockable, persisted workspace - Entity Clusters β SoA batched storage co-locating up to 64 entities per cluster, with cluster-native SIMD predicate evaluation (AVX-512 / AVX2 / scalar dispatch), zone-map pruning, and k-way sorted merge
- Query Engine β Typed queries with
Where,With/Withoutfilters, polymorphic iteration, OR logic, navigation joins, and a cluster execution path that routes filtered scans through SIMD gather-compare on cluster SoA columns - Views & Change Tracking β Incremental entity-set monitoring across transactions (added/removed/modified detection) with ring-buffer delta streaming
- B+Tree Indexes β Cache-aligned 128-byte nodes with optimistic lock coupling and specialized key-size variants
- Spatial Indexing β Page-backed wide R-Tree for AABB / Radius / Ray / Frustum / kNN queries, plus a per-cell cluster broadphase (
SpatialGrid) with BMI2 Morton-encoded cell keys and multi-resolutionSimTierdispatch for near/far/coarse simulation budgets - Write-Ahead Logging β WAL (v2, always on) with configurable durability modes (Deferred, GroupCommit, Immediate) and coalesced tick-boundary snapshots via
TickFence/ClusterTickFencechunks for the runtime tick loop - Page Integrity β CRC32C checksums, suspect-page detection, and crash-recovery rebuild (index + EntityMap); full-page images were retired in favor of a rebuild-based torn-page net
- Schema Versioning β Component revisions with field-level migration support
- Three Storage Modes β Versioned (full MVCC + WAL), SingleVersion (last-writer-wins; per-tx TickFence or Committed durability discipline β atomic, zero-loss, no revision chain), Transient (heap-only, no persistence)
- Configurable Durability β Choose per-UnitOfWork whether data is deferred, group-committed, or immediately fsynced
- Game Server Runtime β Tick-based micro-task
DagSchedulerwith any-worker parallel dispatch, per-system change filters, typed MPSC event queues, side-transactions, cluster dormancy with staggered heartbeat wake, checkerboard Red/Black dispatch, and a 4-level overload response hierarchy (tick-rate modulation, player shedding) - Subscription Server + Client SDK β TCP delta streaming of published views with MemoryPack serialization, per-client incremental sync, backpressure-driven resync, and a zero-engine-dependency
Typhon.Clientassembly for game clients - Observability β Runtime telemetry, metrics, and diagnostics with zero-cost JIT-eliminated toggles
- Deep-Trace Profiler β Per-tick Gantt and flame-graph visualization via a
.typhon-tracebinary format, live TCP streaming to a React/Vite viewer, and optionaldotnet-traceCPU sampling correlation for full managed-stack profiles - Interactive Shell (tsh) β Database REPL for inspection and debugging
- Public/Internal API split β Two namespaces per assembly (
Typhon.Engine/Typhon.Engine.Internals), each subsystem folder split intopublic/+internals/, enforced at compile time by theTYPHON008Roslyn analyzer - Roslyn Analyzers β Custom analyzers detecting undisposed engine resources at compile time + the
TYPHON008internal-API leak detector
A taste β declare a component and an archetype, spawn an entity, read it back:
// A component is a plain struct; an archetype is the fixed set of components an entity has.
[Component("Game.Health", 1, StorageMode = StorageMode.Versioned)]
public struct Health { public int Current, Max; }
[Archetype(1)]
public sealed partial class Unit : Archetype<Unit>
{
public static readonly Comp<Health> Health = Register<Health>();
}
// ...build the engine + register the schema (see the Guide), then:
using var tx = dbe.CreateQuickTransaction();
var id = tx.Spawn<Unit>(Unit.Health.Set(new Health { Current = 100, Max = 100 }));
var hp = tx.Open(id).Read(Unit.Health); // hp.Current == 100
tx.Commit();Illustrative β engine build + schema registration are elided. The User Guide has the full, runnable version (
doc/guide/example).
Typhon is in active development targeting an alpha release. Current state:
- Core transaction engine with MVCC
- B+Tree indexes with optimistic lock coupling
- Component-level durability options
- Write-Ahead Logging with configurable durability modes
- Page integrity (CRC32C, suspect-mode rebuild, checkpoints)
- Query engine with filtering, sorting, and navigation
- Views and incremental change tracking
- ECS archetype system with source-generated accessors
- Entity cluster storage (SoA batched, SIMD predicate evaluation, zone-map pruning, k-way sorted merge)
- Dual page store abstraction (
PersistentStore+TransientStore) - Schema versioning and evolution
- Spatial indexing (page-backed wide R-Tree: AABB / Radius / Ray / Frustum / kNN)
- Spatial grid with per-cell cluster broadphase and BMI2 Morton encoding
- Multi-resolution simulation (
SimTierdispatch, cluster dormancy, checkerboard Red/Black) - Game server runtime (
DagScheduler, parallel system dispatch, overload management, event queues) - Subscription server and
Typhon.ClientSDK (TCP delta streaming, MemoryPack wire protocol) - Deep-trace runtime profiler (
.typhon-traceformat, live TCP streaming, React viewer) - Interactive shell (tsh)
- Observability and monitoring stack
- HashMap collections with key-size specialization
- Workbench dev UI (data browsing, profiler viewer, System DAG view, Data Flow timeline, Access Matrix, internal data API)
- Public/Internal API namespace split +
TYPHON008analyzer - Crash recovery (WAL v2 replay, scrub + index/EntityMap rebuild, suspect-mode)
- Backup and restore
Each engine subsystem folder splits into public/ (consumer surface, namespace Typhon.Engine) and internals/ (implementation, namespace Typhon.Engine.Internals).
Typhon/
βββ src/
β βββ Typhon.Engine/ # Main database engine β 17-feature tree
β β βββ Foundation/ # Cross-cutting primitives
β β β βββ Collections/ # HashMaps, bitmaps, lock-free arrays
β β β βββ Concurrency/ # Latches, AccessControl, epoch system, deadlines, timer service
β β β βββ Memory/ # Memory allocator + block primitives
β β βββ Ecs/ # ECS engine, archetypes, entity clusters, accessors
β β βββ Indexing/ # B+Tree variants (key-size specialized, OLC)
β β βββ Querying/ # Query engine, views, navigation joins, predicates
β β βββ Schema/ # Component & archetype schema, validation, evolution
β β βββ Spatial/ # R-Tree, spatial grid, tier dispatch, trigger zones
β β βββ Storage/ # Pages, cache, segments, PagedMMF / IPageStore / PersistentStore / TransientStore
β β βββ Transactions/ # MVCC transactions, UnitOfWork, change capture
β β βββ Revision/ # Revision chains, deferred cleanup
β β βββ Durability/ # WAL, checkpointing, recovery, FPI capture
β β βββ Runtime/ # DagScheduler, tick loop, systems, overload management, queues
β β βββ Subscriptions/ # TCP delta streaming server, published views
β β βββ Profiler/ # In-engine typed-event profiler (codecs in Typhon.Profiler/)
β β βββ Observability/ # Telemetry config, metrics, diagnostics
β β βββ Resources/ # Resource graph, lifecycle, options
β β βββ Errors/ # Exception hierarchy, deadline propagation
β β βββ Hosting/ # DI extensions, service collection helpers
β βββ Typhon.Analyzers/ # Roslyn analyzers (dispose detection + TYPHON008 internal-API leak)
β βββ Typhon.Client/ # External client SDK (TCP subscriptions, zero engine deps)
β βββ Typhon.Generators/ # Source generators (archetype accessors, traced-event encoders, source location)
β βββ Typhon.Profiler/ # Trace file format, readers/writers, sidecar cache, Chrome Trace exporter
β βββ Typhon.Protocol/ # MemoryPack wire-format types (TickDeltaMessage, etc.)
β βββ Typhon.Schema.Definition/ # Component & archetype attributes
β βββ Typhon.Shell/ # Interactive database shell (tsh)
β βββ Typhon.Shell.Extensibility/ # Shell extension points
βββ test/
β βββ Typhon.Engine.Tests/ # NUnit test suite (3500+ tests)
β βββ Typhon.Client.Tests/ # Client SDK tests
β βββ Typhon.Workbench.Tests/ # Workbench server-side tests
β βββ Typhon.Benchmark/ # BenchmarkDotNet performance tests
β βββ Typhon.ARPG.Schema/ # Example ARPG game schema
β βββ Typhon.ARPG.Shell/ # Shell demo with ARPG data
β βββ Typhon.MonitoringDemo/ # Observability demo
β βββ Typhon.IOProfileRunner/ # Storage I/O profiling sandbox
β βββ Typhon.Scheduler.POC/ # DagScheduler POC harness
β βββ Typhon.SqliteBenchmark/ # Comparative SQLite benchmark
β βββ AntHill/ # Godot-based ant-colony demo (runtime + clusters + spatial tiers)
βββ tools/
β βββ Typhon.Workbench/ # Local dev UI (ASP.NET Core 10 + React 19/Vite) β data browsing, schema, profiler, System DAG, Data Flow timeline, Access Matrix
β βββ Typhon.Workbench.Fixtures/ # Dev-only test fixture generators consumed by the Workbench DEBUG tabs
β βββ CheckDurations/ # Helper utility for tick-duration analysis
βββ claude/ # Architecture docs, ADRs, design specs (separate nested git repo)
βββ benchmark/ # Benchmark results
This project has had quite a journey:
- 2015 β Initial bootstrap with a different design, quickly shelved
- 2020 β COVID resurrection as a POC: "Can we build a Β΅s-latency ACID database for persistent games?" Promising results, then shelved again
- 2025 β Third resurrection with firm intention to reach alpha stage
- 2025-2026 β Rapid progress: WAL & durability, query engine, ECS archetype system with source generators, schema evolution, observability stack, and interactive shell delivered
- Q2 2026 alpha push β Game-server runtime (
DagScheduler, parallel system dispatch, overload management), entity clusters with cluster-native SIMD query execution, dual page store abstraction (PersistentStore+TransientStore), spatial indexing (page-backed R-Tree + spatial grid cluster broadphase), multi-resolutionSimTierdispatch with cluster dormancy and checkerboard, TCP subscription server with zero-engine-dependency client SDK, and a deep-trace runtime profiler with live-streaming viewer - Q2 2026 Workbench buildout β Internal Data API + System DAG view (#306, #314, #322), static schema export and Schema Inspector (#326), Data Flow Timeline + Access Matrix panels with cross-panel selection and hover linking (#327)
- Q2 2026 API hardening β Public/Internal namespace migration, accessibility flips, friend-list audit, and leak-tightening pass: ~430 internal types now in
Typhon.Engine.Internalsenforced by theTYPHON008analyzer (#329) - Q2 2026 durability redesign β Minimal WAL (WAL v2 format,
RecoveryDriver, checkpoint v2 A/B slot-pairing), the Committed durability discipline (#392), cluster crash durability (#395), BulkLoad write path + storage hardening (#383), and retirement of full-page images in favor of a suspect-mode rebuild recovery net (#399, #401) - Q2 2026 Workbench redesign β shell rebuild (Stages 0β4), read-only Data Browser, zoomable Database File Map, off-CPU + integrated CPU-sample profiling, TrackβDAG / Critical Path rework, the AntHill validation harness, and Query Console Phase 1 β write/execute/browse queries against a live store (#379, #390)