ArcFlow
Company
Managed Services
Markets
  • News
  • LOG IN
  • GET STARTED

OZ brings Visual Intelligence to physical venues, a managed edge layer that lets real-world environments see, understand, and act in real time.

Talk to us

ArcFlow

  • World Models
  • Sensors

Managed Services

  • OZ VI Venue 1
  • Case Studies

Markets

  • Sports
  • Broadcasting
  • Robotics

Company

  • About
  • Technology
  • Careers
  • Contact

Ready to see it live?

Talk to the OZ team about deploying at your venues, from a single pilot match to a full regional rollout.

Schedule a deployment review

© 2026 OZ. All rights reserved.

LinkedIn
ArcFlow Docs
Get Started
  • Get Started
  • Quickstart
  • Installation
  • Project Setup
  • Platforms
  • Bindings
  • Licensing
  • Pricing
Capabilities
  • Vector Search
  • Graph Algorithms
  • Sync
  • MCP Server (AI Agents)
  • Live Queries
  • Programs
  • Temporal
  • Spatial
  • Trusted RAG
  • Behavior Graph
  • Agent-Native
  • Event Sourcing
  • GPU Acceleration
  • Intent Relay
Concepts
  • World Model
  • Graph Model
  • Query Language (GQL)
  • Graph Patterns
  • SQL vs GQL
  • Parameters
  • Query Results
  • Persistence & WAL
  • Error Handling
  • Observations & Evidence
  • Confidence & Provenance
  • Proof Artifacts & Gates
  • Skills
GQL / WorldCypher
  • Overview
  • MATCH
  • WHERE
  • RETURN
  • OPTIONAL MATCH
  • CREATE
  • SET
  • MERGE
  • DELETE
  • REMOVE
  • WITH
  • UNION
  • UNWIND
  • CASE
  • Spatial Queries
  • Temporal Queries
  • Algorithms Reference
  • Triggers
Schema
  • Overview
  • Indexes
  • Constraints
  • Data Types
Functions
  • Built-in Functions
  • Aggregations
  • Procedures
  • Shortest Path
  • EXPLAIN
  • PROFILE
Skills
  • Overview
  • CREATE SKILL
  • PROCESS NODE
  • REPROCESS EDGES
Operations
  • CLI
  • REPL Commands
  • Snapshot & Restore
  • Server Modes & PG Wire
  • Persistence
  • Import & Export
  • Docker
  • Architecture
  • Cloud Architecture
  • Sync Protocol (Deep Dive)
Guides
  • Agent Integration
  • World Model
  • Graph Model Fundamentals
  • Trusted RAG
  • Using Skills
  • Behavior Graphs
  • Swarm & Multi-Agent
  • Migration Guide
  • Filesystem Workspace
  • From SQL to GQL
  • ArcFlow for Coding Agents
  • Data Quality & Pipeline Integrity
  • Code Intelligence
Tutorials
  • Knowledge Graph
  • Entity Linking
  • Vector Search
  • Graph Algorithms
Recipes
  • CRUD
  • Multi-MATCH
  • MERGE (Upsert)
  • Full-Text Search
  • Temporal Queries
  • Batch Projection
  • GraphRAG
Use Cases
  • Agent Tooling
  • Knowledge Management
  • RAG Pipeline
  • Fraud Detection
  • Sports Analytics
  • Grounded Neural Objects
  • Behavior Graphs
  • Autonomous Systems
  • Digital Twins
  • Robotics & Perception
Reference
  • TypeScript API
  • GQL Conformance
  • Compatibility Matrix
  • Glossary
  • Data Types
  • Operators
  • Error Codes
  • Known Issues

Persistence & WAL

ArcFlow uses a write-ahead log (WAL) for durability. All mutations are journaled before they're applied.

In-memory vs. persistent#

import { open, openInMemory } from 'arcflow'
 
// In-memory: fast, lost on exit. Great for tests.
const mem = openInMemory()
 
// Persistent: WAL-journaled, survives crashes and restarts.
const disk = open('./data/graph')

How persistence works#

  1. Write: mutations are appended to the WAL before being applied
  2. Crash: if the process dies, the WAL retains all committed mutations
  3. Recovery: on next open(), the WAL replays automatically — no data loss
  4. Background checkpoint: the WAL is periodically compacted into a snapshot in a background thread — no write pause

Read path — MVCC lock-free reads#

The read path uses a copy-on-write store with atomic snapshot swaps. Readers load the current graph snapshot via an atomic pointer swap — no read lock, no contention with writers. Writes produce a new snapshot and atomically swap it in. This means:

  • db.query() never blocks on a concurrent db.mutate()
  • db.mutate() never blocks on concurrent reads
  • Zero-copy commit: the committed snapshot is swapped in atomically without copying
const db = open('./my-graph')
 
// This mutation is WAL-journaled
db.mutate("CREATE (n:Important {data: 'critical'})")
 
// Process crashes here...
 
// On restart — WAL replays, data is recovered
const db2 = open('./my-graph')
const result = db2.query("MATCH (n:Important) RETURN n.data")
console.log(result.rows[0].get('data'))  // "critical"

Checkpoints#

Query checkpoint metadata:

const cp = db.query("CALL db.checkpointMeta")
console.log(cp.rows[0].toObject())  // { generation, nodeCount, mutationSeq }

In the CLI REPL, use :checkpoint to save a snapshot:

arcflow> :checkpoint

Integrity verification#

Compute a cryptographic fingerprint of the graph state:

const fp = db.query("CALL db.fingerprint")
console.log(fp.rows[0].get('fingerprint'))  // sha256:...

Data directory structure#

./my-graph/
├── worldcypher.snapshot.json   # Compacted snapshot (after checkpoint)
└── wal/                        # Write-ahead log segments

Closing the database#

Call close() for a clean shutdown that flushes the WAL:

db.close()

After closing, all operations will throw an ArcflowError with code DB_CLOSED.


See Also#

  • Persistence & WAL — server-mode persistence and WAL configuration
  • Snapshot & Restore — graph backup and migration
  • Event Sourcing — every mutation as a temporal fact in the WAL
  • Temporal Queries — AS OF seq N queries over the persisted history
Try it
Open ↗⌘↵ to run
Loading engine…
← PreviousQuery ResultsNext →Error Handling