# We replaced Neo4j with our own Rust engine. This is what it cost

> Six months, about $1,500 in experiments, compute and VPS, and roughly a month of my own hours. The ledger of moving RushDB off Neo4j, and what the money doesn't count.

Canonical URL: https://rushdb.com/blog/replaced-neo4j-rust-engine-cost
Published: 2026-11-29T00:07:00.000Z
Updated: 2026-11-29T09:41:51.273Z
Author: Artemiy Vereshchinskiy
Category: Engineering

In the [last essay](https://rushdb.com/blog/time-to-move-on-from-neo4j) I explained why RushDB left Neo4j. This one is about the bill. Everybody says writing your own database is the hard path, and they mean it costs years and a team. Ours cost six months, about $1,500, and roughly one month of my own working hours. Those numbers are true, and they're also a bit misleading, so here is the whole ledger.

## The ledger

| Phase | Time | What happened |
|---|---|---|
| Planning | 1 month | No code. Architecture decisions, features, behaviour, target goals and performance bars |
| Engineering | 3 months | Building the engine: storage, transactions, catalog, query planning, vectors, languages |
| Hardening | 2 months | Benchmarks, tests, QA, fixes, edge cases, and wiring the protocols and drivers |
| **Money** | | **About $1,500** for experiments, compute and VPS |
| **My time** | | **Roughly one full month of hours**, spread over the six |

Nobody estimated human engineering time here, because there was basically one human. The $1,500 is cash out of pocket. It doesn't price my month, and it doesn't price the things I list further down, which are the bigger part.

What came out: one binary, 20 Rust crates, about 142,000 lines of Rust including tests, a 75-page manual and about 1,370 tests, all green, at 3.0.0. Four weeks and fifteen patch releases later, at 3.0.15, that's about 193,000 lines, 78 pages and about 1,790 tests.

It speaks HTTP, the Postgres wire protocol, gRPC, Bolt and MCP, and reads the same records through SQL, our native query format, openCypher, GQL, Gremlin, SQL/PGQ and Mongo-style queries. Some of those are release candidates, and I'll get to that.

## One month without code

The month of planning is the part I'd defend hardest. Code gets built exactly as described, and nothing in the build notices that you described the wrong thing. So before any code I wrote down what the engine is for, and, more important, what it's not for. From the planning doc:

> RushDB wins on many small, schema-unknown tenants that need hybrid queries and grounded agent exploration. It does not try to beat Qdrant, ClickHouse or Neo4j at their own benchmarks.

And a list of things we explicitly don't optimize for: billion-vector single-collection search, terabyte BI scans, deep graph algorithms, being a transactional system of record. That list saved more time than anything else, because every time a fun direction showed up, the answer was already written down.

Decisions were marked settled or open. Settled ones were not to be re-argued in code, only in a PR description. Open ones meant asking before building on them. Plus performance bars per feature, so "done" meant hitting a number. A few settled decisions still got reopened later, when measurements disagreed with them, and that's fine. Reopening one decision with data is cheap. Drifting away from twenty decisions silently is how you get a database nobody can reason about.

## What the $1,500 doesn't count

The misleading part is everything the money didn't pay for.

**The years on Neo4j.** RushDB 2.x ran on Neo4j for two major versions. Every workaround in that codebase was a lesson about what the engine has to do natively: a catalog that is exact, tenants as key ranges, filters before vector ranking. I didn't spend those months figuring out what to build. I already knew, from years of fighting it.

**The shoulders.** I didn't write a SQL planner: DataFusion did that. openCypher, GQL and Gremlin parsing come from Grafeo. redb, openraft and tokio are in there too. Without that open-source stack the bill is years, and IMO anyone who says "we built a database in six months" without naming theirs is not being fair.

**My month.** One month of hours sounds small. It was the dense kind: reading every plan, rejecting half of them, running benchmarks at night and reading the results in the morning.

## What I paid in learning

This is the cost I'm happiest about. Some of it came with numbers.

**HNSW needs calibrating.** I expected approximate vector search to be a switch you turn on. In our laptop runs on an October build, a 768-d HNSW query took about 0.24–1.1 ms once the graph was built, but the build took 2.1 s at 5,000 vectors and 47.6 s at 50,000. Recall@10 on random vectors was 0.63 at `ef` 64 and 0.84 at `ef` 256. So the index answers fast, it gets built slowly, and it's wrong more often than people assume. Every knob is a trade.

**Brute force is better than its reputation, until it isn't.** Exact search cost about 1.7 µs per 768-d vector up to 10,000 vectors. For a small tenant that's literally nothing, so RushDB searches small spaces exactly and switches to HNSW only once the graph is resident.

The cut-off started as a flat 5,000 vectors; since 3.0.13 the engine compares the cost of both paths per search, so at the default `ef` of 128 an unfiltered 768-d space is searched exactly up to about 24,000 vectors. The limit showed up at 1M vectors on default cache settings: the graph didn't fit, search fell back to exact, 4.5 s. That's where "brute force is fine" ends. (Since 3.0.1 vectors get their own cache, and a 1M space answers from its index on default settings.) Details in [brute force vs HNSW](https://rushdb.com/blog/brute-force-vs-hnsw).

**Rust itself.** I wasn't a Rust engineer when this started. Reviewing every change to the engine forced me to learn it properly: ownership, lifetimes, async that must never block the storage path, and why one lock in the wrong place turns into a throughput ceiling. You can't review what you can't read, so learning it wasn't optional.

**Bottlenecks live where you don't look.** In September, a record cost 13–20 KB on disk at its worst. Storage format v5 measures 3.44 KiB. One `count(*)` without an index took 772 s on a 30M-record tenant, and it wasn't CPU: it streamed 66 GB through a 21 GB page cache and evicted the pages every other client needed, so their p99 went up 6.6× ([the postmortem](https://rushdb.com/blog/slow-count-postmortem)). Single-record commits top out around 1,015 per second in one tenant with 32 writers sending them (114/s with one), because every commit goes through a single writer, and that one is [by design](https://rushdb.com/blog/single-writer-by-design). Each of these I'd have bet against before measuring. (All of them were measured on storage format v5; 3.0.0 wrote format 6, and 3.0.14 moved to format 7.)

## The bill isn't closed

To be fair about what six months didn't buy:

- openCypher is a release candidate. Of the 2,422 openCypher TCK scenarios in our Cypher profile, 2,017 pass (83%, up from 57% at 3.0.0); the other 405 fail on known defects in Grafeo, the planner we embed. The full suite has 3,897, and 1,475 of them test things outside the profile (temporal types beyond the ISO date, local time, local datetime, datetime and duration, multi-label nodes, procedures). Point a Neo4j app at RushDB and parts of it will fail, so read [our Bolt compatibility notes](https://rushdb.com/blog/neo4j-driver-bolt-compatibility) before you try.
- It runs as a single node. Replication is asynchronous with manual promotion, and Raft-based HA is still cooking (it's a preview behind an experimental flag, not something to run in production).
- It's [qualified up to 30M records](https://rushdb.com/blog/rushdb-capacity-envelope) on one node, and at that size reads that visit every candidate are already slow.

And a funny one. Writing this blog series, every article got a runnable example, and running them turned up eleven bug reports in two days: pgwire gaps that stopped psql from reading an INSERT, a nested `$or` that silently matched nothing, a data-access policy that hid a field but still let you filter on it. Most were fixed in 3.0.1, and a few are documented as known defects in the libraries underneath. Six months of tests didn't catch them. Ten minutes of "let me show a reader how this works" did. Hardening never really ends, it just moves to whoever uses it next.

## Was it worth it?

For RushDB it was worth it. The money was cheap, the attention wasn't, and what we got is an engine whose shape matches its promise, with no middleman between us and the storage.

For you, maybe not. If you need mature clustering, a big graph algorithm library, years of production hardening and an ecosystem around it, Neo4j is still the safer foundation, and a six-month engine doesn't change that. What changed is the price of trying. The code got cheap. Knowing what to build didn't.

If you have the second part, one month of planning -> three of building -> two of breaking it is a real path now.
