Why Anvil

The database that replaces the stack

Anvil is a Rust-powered graph database that absorbed the rest of your data layer: documents, files, auth, GraphQL, and multi-tenancy - with capabilities that don't exist anywhere else.
Only in Anvil

Things no other database has done

Not a longer feature list - different capabilities. These are the combinations you currently assemble from three to five separate systems, shipped here as database primitives.
01First of its kind

One record, two models - kept in sync both directions

Every other stack makes you choose: model it as a graph or as documents, then build brittle ETL between the two. Anvil's sync rules bind a node label to a document collection bidirectionally - write a :User node and the auth.users document updates; delete a field from the document and it leaves the node. Conflict resolution, cascade semantics, and trigger ordering are built in. No pipeline, no drift, one source of truth queryable both ways.

SYNC LABEL Person TO COLLECTION persons KEY id
  INCLUDE name, email  -- BIDIRECTIONAL by default

MATCH (p:Person {name: 'Ada'}) RETURN p     -- graph view
GET /docs/persons/ada                        -- document view, same record
Graph-document sync docs →
02Security

Column-level security that follows data across models

Row-level security exists elsewhere. Anvil goes further: property masks hide individual fields per role, and both policies and masks travel through sync pairs - hide email on the :User label and it is hidden in the auth.users collection, in Cypher results, in the REST document API, and in the graph endpoint. One rule, every surface. Readers can't see user emails out of the box.

HIDE PROPERTY email ON :User FROM reader
-- masked in MATCH results, GET /docs/auth.users/*, and /db/graph
Row-level security docs →
03Multi-tenancy

Tenants as a database primitive - with portable backups

Apps give every tenant an isolated schema, its own labels and collections, per-tenant settings, and custom auth emails - inside one server. Then the part nobody else ships: one call exports a tenant as a self-contained JSON bundle (data, subgraph, policies, triggers, templates, members), and one call restores it as a new tenant with ids remapped and links to shared identity re-attached. Tenant migration between servers becomes a file copy.

CREATE APP 'crm' NAME 'Customer CRM'
APP 'crm' ADD MEMBER 'alice' PRIVILEGE editor
GET  /apps/crm/export        -- whole tenant as one JSON file
POST /apps/import?slug=crm2  -- restored, remapped, re-linked
Apps & projects docs →
04Operability

The entire platform speaks Cypher

Not just queries. Indexes, triggers, stored functions, RLS policies, property masks, sync rules, storage buckets, runtime settings, and whole tenants are all created, listed, and dropped in Cypher. One language, one audit trail, one mental model - from CREATE INDEX to CREATE APP to SET SETTING, scriptable end to end.

CREATE UNIQUE INDEX ON :User(email)
CREATE TRIGGER after_signup AFTER INSERT ON :User AS { ... }
CREATE POLICY own_rows ON :Order FOR SELECT USING (n.owner = current_user())
CREATE BUCKET avatars PUBLIC
SET SETTING 'app.crm.auth.email.smtp_from' = 'CRM <noreply@crm.io>'
Cypher reference →
05Identity

Auth you can traverse

Users, roles, sessions, and tenant memberships aren't rows in a hidden system table - they are graph nodes and relationships you can MATCH like any other data. Link your domain straight to identity ((:Order)-[:PLACED_BY]->(:User)), query who can do what, and get passwordless OTP login, email verification by link or code, service accounts, and per-tenant SMTP - without bolting on an auth service.

MATCH (u:User)-[m:MEMBER_OF]->(a:App {slug: 'crm'})
RETURN u.username, m.privilege
Authentication docs →
06Footprint

Five services in one safe-Rust binary

A typical stack wires a graph database to a document store, an object store, an auth provider, and a GraphQL layer - five services, five configs, five failure modes. Anvil ships all of it as one self-hostable binary with TLS termination, WAL-first durability, ARIES recovery, snapshots, and the Hammer admin UI included. Your data stays on your hardware.

Install in one command →
Consolidation

One binary instead of a stack

In AnvilUsually requires
Graph queries & algorithmsa dedicated graph database
JSON documents with TTL & indexesa document database
Buckets, signed URLs, image transformsan object storage service
Users, OTP login, service accountsa hosted auth provider
Auto-generated GraphQL APIa GraphQL middleware layer
Multi-tenant isolation & backupshand-rolled application code

One config file, one process to monitor, one backup story - and every piece is aware of the others: storage events fire Cypher triggers, RLS spans documents and nodes, auth is part of the graph.

The Full Toolkit

Every core capability

The distinctive parts sit on a complete, production-grade database. Everything below ships in the same binary.

Cypher Query Engine

Full Cypher with multi-hop BFS pattern matching, quantified paths, ALL SHORTEST, ORDER BY/LIMIT/SKIP/DISTINCT, comma-separated patterns, MERGE, and aggregation - all in safe Rust.

ACID Transactions

Multi-version concurrency control with snapshot isolation, automatic deadlock detection, write-ahead logging, and ARIES-style crash recovery.

Graph Algorithms

Built-in PageRank, Dijkstra, community detection, betweenness centrality, and more - executed natively on the storage engine for maximum throughput.

Plugin Ecosystem

Extend Anvil with Rust, Lua, Python, WASM, JavaScript, TypeScript, or Starlark plugins. Ship custom functions, procedures, and storage backends.

Clustering & Replication

Raft-based consensus for leader election, WAL streaming replication for read replicas, and hash-based sharding for horizontal scale-out.

GraphQL API

Auto-generated GraphQL schema from your graph model with Relay-spec connections, real-time subscriptions, and batched DataLoader queries.

Native Document Store

Built-in NoSQL with schema-namespaced collections, composite keys, TTL, secondary indexes, and bidirectional graph-document sync - no separate database needed.

File Storage

Built-in object storage with content-addressed blobs, signed URLs, on-the-fly image transforms, TUS resumable uploads, and pluggable backends (local, S3, R2, MinIO).

Row-Level Security

PostgreSQL-inspired RLS policies on nodes, relationships, and documents with sync pairs - plus column-level property masks like HIDE PROPERTY email ON :User FROM reader.

Authentication

Graph-native auth with JWT RS256 tokens, JWKS endpoint, Argon2id password hashing, refresh tokens, and per-request session middleware.

Apps & Multi-Tenancy

First-class apps: each tenant gets its own isolated schema, membership with reader/editor/admin privileges, scoped settings, custom auth emails, and one-click JSON backup & restore.

Functions & Triggers

Stored Cypher functions with typed parameters and CALL...YIELD. Event-driven triggers on INSERT/UPDATE/DELETE with BEFORE/AFTER timing and OLD/NEW variables.

Observability

Built-in event log, slow query detection, query analytics with p95/p99 latency, dependency analysis, and configurable alert rules.

Data Import

Import Neo4j-compatible Cypher scripts via CLI, REST API, or Hammer UI. Supports multi-CREATE, MERGE, and variable binding across statements.

Edge Functions

Run JavaScript/TypeScript on the server via HTTP endpoints. Deno or Node.js subprocess runtime with on-demand execution.