Anvil DB
| Original author(s) | Benjamin C. Tehan |
|---|---|
| Developer(s) | Devforge Pty Ltd |
| Initial release | April 2026 |
| Stable release | 0.1.0 (Public Alpha)
|
| Repository | github |
| Written in | Rust |
| Engine | |
| Operating system | Linux, macOS, Windows |
| Type | Graph database |
| License | Proprietary (Hammer UI: MIT License) |
| Website | anvildb |
Search Anvil DB on Amazon.
Anvil DB is a graph database written in Rust, developed by Devforge Pty Ltd. It combines a property graph model with a native document store, Cypher query language support, a GraphQL API, ACID transactions, and built-in graph algorithms. The project includes a web-based administration interface called Hammer UI built with React and TypeScript.
History
Anvil DB was created by Benjamin C. Tehan, an Australian software engineer and founder of Devforge Pty Ltd. Development began in 2025 with the goal of building a high-performance graph database in Rust that unifies graph and document data models in a single binary. The first public alpha (version 0.1.0) was released in April 2026.
The project was motivated by the observation that many graph database deployments require a separate document store alongside the graph for unstructured or semi-structured data, introducing operational complexity and data synchronization challenges.[1]
Architecture
Anvil DB is implemented as a single statically-linked binary with no external runtime dependencies. The system is organized into 13 Rust workspace crates:[1]
Storage engine
The storage engine uses a page-based architecture with configurable page sizes (4 KB or 8 KB). It employs a write-ahead logging (WAL) system with CRC32 checksums for crash recovery, following the ARIES recovery protocol with redo and undo phases. Data is stored across multiple files: graph.db, properties.db, strings.db, labels.db, and schema.db.
Indexing is provided through B+ tree structures supporting unique, composite, full-text, and spatial index types. The engine includes an LRU page cache with configurable memory budget, read-ahead optimization for sequential scans, and write batching for grouped I/O operations. Optional LZ4 and Zstd compression is available for stored data.
Query engine
The Cypher query engine consists of a hand-written lexer, recursive descent parser, semantic analyzer, type checker, cost-based optimizer, and a Volcano-model executor with 25+ physical operators. The optimizer uses cardinality estimation and index selection to generate execution plans.
Supported query features include multi-hop BFS pattern matching, quantified path patterns (e.g., -[:KNOWS]->{2,5}), all-shortest-path finding, regular expression filtering, and full aggregation with implicit grouping semantics. The engine also supports EXPLAIN and PROFILE for query plan analysis.
Transaction model
Anvil DB implements ACID transactions using multiversion concurrency control (MVCC) with version chains. Three isolation levels are supported: read committed, repeatable read, and serializable. The system uses record-level locking with intent locks and includes deadlock detection via a wait-for graph, automatically aborting the youngest transaction in a cycle. Savepoints are supported for partial rollback within transactions.
Features
Cypher query language
Anvil DB implements the Cypher query language originally developed for Neo4j.[2] The implementation includes standard clauses such as MATCH, CREATE, MERGE, SET, DELETE, WITH, UNWIND, UNION, ORDER BY, SKIP, LIMIT, and FOREACH.
Beyond the standard Cypher specification, Anvil extends the language with:
- Document operations —
CREATE DOCUMENT,MATCH DOCUMENT,UPSERT DOCUMENT, andDELETE DOCUMENTclauses for interacting with the built-in document store directly from Cypher queries - Stored functions —
CREATE FUNCTIONwith typed parameters, return types, and function bodies that can query both graph and document data - Triggers —
CREATE TRIGGERfor event-driven logic on graph label and document collection changes, withBEFORE/AFTERtiming andOLD/NEWpseudo-variables - Row-level security —
CREATE POLICYfor defining access control predicates - Sync rules —
SYNC LABEL ... TO COLLECTIONfor bidirectional graph-document synchronization
The engine includes 55+ built-in functions spanning aggregation, string manipulation, mathematics, list operations, temporal, and spatial categories.
Document store
Anvil DB includes a native document store that eliminates the need for a separate NoSQL database alongside the graph. Documents are organized into schema-namespaced collections (public.* for application data, auth.* for system data). Features include composite keys (partition key plus sort key), TTL with automatic expiry, global and local secondary indexes, batch operations, and filter expressions.
The document store supports three storage modes: unified (graph and documents in a single file), split with shared WAL, and split with independent WALs.
Graph-document synchronization
A distinctive feature of Anvil DB is bidirectional synchronization between graph nodes and document collections. Sync rules define mappings between graph labels and collections, with configurable field inclusion and conflict resolution strategies (last-write-wins, graph-wins, or document-wins). Changes propagate within the same transaction, maintaining consistency across both data models.
GraphQL API
Anvil DB auto-generates a GraphQL schema from the graph structure, providing Relay-specification connections for cursor-based pagination, real-time WebSocket subscriptions via the graphql-transport-ws protocol, filtering, ordering, nested traversals, and Cypher passthrough queries.
Row-level security
Inspired by PostgreSQL's row-level security,[3] Anvil DB supports fine-grained access control through predicate-based policies. Policies can be defined on graph labels, relationship types, and document collections, with both permissive (OR logic) and restrictive (AND logic) modes. Session variables enable multi-tenancy patterns. A policy simulator allows testing access rules before deployment.
Authentication
The authentication system stores users and roles as graph nodes and documents, using JWT RS256 tokens with persistent RSA key pairs. Passwords are hashed using Argon2id. A JWKS endpoint (/.well-known/jwks.json) is exposed for external token verification. Default roles include admin, editor, and reader with configurable privilege tiers.
Graph algorithms
Anvil DB includes built-in implementations of common graph algorithms executed natively on the storage engine:[1]
- Centrality — PageRank, betweenness centrality, closeness centrality, degree centrality
- Community detection — Louvain method, label propagation
- Pathfinding — Dijkstra's algorithm, A*, BFS, DFS
- Other — connected components, minimum spanning tree, triangle counting, node similarity
Plugin system
The database supports extensions through a plugin SDK supporting native Rust plugins and scripting via Lua, Python, WebAssembly, JavaScript, TypeScript, and Starlark. Plugins can register custom Cypher functions and procedures, and operate in sandboxed namespaces with hot-reload capability.
Edge functions
Anvil DB supports serverless-style edge functions written in JavaScript or TypeScript, executed via Deno or Node.js subprocess runtimes. Edge functions are triggered via HTTP endpoints at /functions/v1/{name}.
Clustering
The clustering subsystem provides leader-follower replication via WAL streaming, Raft consensus for leader election, read replicas with causal consistency, and hash-based or label-based sharding. Rolling upgrades are supported for zero-downtime deployments.
TLS support
Anvil DB supports TLS encryption via Rustls, configured through tls_cert and tls_key settings in the [server] section of anvil.toml, or via ANVIL_TLS_CERT and ANVIL_TLS_KEY environment variables. When configured with PEM certificate and key files, the server automatically serves HTTPS.
Hammer UI
Hammer is the web-based administration and query interface for Anvil DB. It is built with React 19, React Router 7, TypeScript, and Tailwind CSS 4, and is licensed separately under the MIT License.
Interface
Hammer provides a dark-themed single-page application with a sidebar navigation, command palette (Cmd+K), and schema selector for switching between public and auth namespaces. The interface includes the following pages:
- Query Editor — Cypher editor with syntax highlighting, multi-statement support, parameter panel, and query history. Results are displayed in table, JSON tree, graph visualization, or execution plan views, with CSV and JSON export.
- Graph Visualization — Force-directed graph layout powered by D3.js with zoom/pan, node dragging, lasso selection, context menus, a minimap, and PNG/SVG export. A focus mode isolates a selected node's neighborhood in a circular layout.
- GraphQL Explorer — Interactive GraphQL editor with schema introspection.
- Schema Browser — Displays labels, relationship types, property keys, indexes, and constraints with a meta-graph visualization.
- Document Manager — Collection CRUD, document browsing with pagination, and sync rule management.
- Functions Manager — Interface for creating, editing, and testing stored database functions.
- Triggers Manager — Trigger creation, status monitoring, and execution statistics.
- Policy Manager — Row-level security policy editor with a policy simulator.
- Data Import — Upload and execute Cypher script files.
- Monitoring Dashboard — Displays active queries, store sizes, memory usage, transaction statistics, throughput charts, and a slow query log.
- Admin Panel — User and role management, database administration, event log viewer, and alert configuration.
- Settings — Theme selection, editor preferences, and graph visualization defaults.
- Help — Comprehensive built-in documentation covering Cypher syntax, API reference, functions, triggers, and security.
Deployment
Hammer can be deployed independently from the Anvil DB server. It is commonly hosted on platforms such as Vercel and configured to connect to a remote Anvil instance via the VITE_ANVIL_API_URL environment variable. When co-located with the server, it automatically detects the API endpoint using the current page protocol and the default Anvil port (7474).
Configuration
Anvil DB is configured through a TOML file (anvil.toml), with settings resolved in the following precedence order: CLI flags, environment variables (ANVIL_* prefix), configuration file, then built-in defaults.
| Section | Key settings |
|---|---|
[server] |
HTTP port (default 7474), Bolt port (7687), bind address, max connections, TLS certificate and key paths |
[storage] |
Data directory, page size, page cache size, WAL sync mode, document storage mode (unified/split), checkpoint interval |
[memory] |
Initial and maximum heap size, page cache ratio, query memory limit |
[query] |
Timeout, max result rows, prepared statement cache, result cache TTL, parallel thread count |
[logging] |
Log level, format (JSON/text), query logging mode, slow query threshold |
[auth] |
Enable/disable authentication, default password, JWT settings, token TTLs |
[plugins] |
Plugin directory, auto-load flag |
[replication] |
Mode (standalone/leader/follower), leader address |
Installation
Anvil DB is distributed as a single binary. Installation scripts are provided for Linux/macOS (install.sh) and Windows (install.ps1), which place the binary and configuration in platform-appropriate system directories. On Linux, these are /usr/local/bin/anvil, /etc/anvil/ (configuration), /var/lib/anvil/ (data), and /var/log/anvil/ (logs). Building from source requires Rust 1.85 or later.
Client drivers
Official client drivers are provided for four languages:
| Language | Package | Connection URI |
|---|---|---|
| Rust | anvilent (crate) |
anvil://user:pass@host:port/db
|
| TypeScript / JavaScript | anvilent (npm) |
anvil://user:pass@host:port/db
|
| Python | anvilent (pip) |
anvil://user:pass@host:port/db
|
| Go | github.com/anvildb/anvilent/go |
anvil://user:pass@host:port/db
|
All drivers support the anvil+tls:// URI scheme for encrypted connections.
Comparison with other graph databases
| Feature | Anvil DB | Neo4j | Amazon Neptune | ArangoDB |
|---|---|---|---|---|
| Language | Rust | Java | Proprietary (AWS) | C++ |
| Query language | Cypher (extended) | Cypher, GQL | SPARQL, Gremlin, openCypher | AQL |
| Document store | Built-in | No | No | Built-in |
| GraphQL API | Built-in | Plugin | No | Built-in (Foxx) |
| Row-level security | Built-in | Enterprise | IAM-based | No |
| Graph algorithms | Built-in | GDS library (separate) | Neptune Analytics | Pregel-based |
| Plugin system | Rust, Lua, Python, WASM, JS/TS, Starlark | Java | No | Foxx (JS) |
| Web UI | Hammer (built-in) | Neo4j Browser | Neptune Workbench | Web UI |
| License | Proprietary | GPL / Commercial | Proprietary (AWS) | Apache 2.0 |
See also
- Graph database
- Cypher (query language)
- Property graph
- Neo4j
- Document-oriented database
- Rust (programming language)
References
- ↑ 1.0 1.1 1.2 "Anvil DB Documentation". Retrieved 2026-04-09.
- ↑ "openCypher Specification". Retrieved 2026-04-09.
- ↑ "PostgreSQL Row Security Policies". Retrieved 2026-04-09.
External links
Category:Graph databases Category:NoSQL Category:Databases Category:Software written in Rust Category:Document-oriented databases Category:Proprietary database management systems Category:2026 software Category:Database management systems
This article "Anvil DB" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Anvil DB. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
