An embedded document database for an app's data, from the page to the server: state its screens follow live, a replica on the device that syncs with the server, many clients writing into one file through one writer and sharing their disk syncs, a server that usually needs no cache in front of it, a file per tenant in every region, and search built in -- BM25 over text with typos, highlights and facets, and vectors for meaning. Written in Rust with no dependencies but TLS's (rustls, in the server, the router and the shell), it runs inside a web page as 353 KB of gzipped WebAssembly, in an iOS, Android or Flutter app as a file on the device, in a Rust process, or as a server any language reaches over HTTP, and it has its own query language (FennecQL).
fennecdb.com — the website and documentation. The
home page shows each part at work, and its playground runs the real
WebAssembly module in your browser with fennec studio over it.
Source in site/: make site-serve runs it locally, make site-deploy
publishes it to Cloudflare Workers.
create collection orders (
customer text @hash,
status text @hash,
total int,
placed timestamp @sorted
)
get orders select id, total, placed
where customer = $1 and status = "open"
order placed desc
limit 20
The same query from JS, and kept live: a write that changes what it reads draws the screen again -- no ORM, no npm, no build step:
const open = db.from('orders')
.select('id', 'total', 'placed')
.where('customer', customer)
.where('status', 'open')
.order('placed', 'desc')
.limit(20);
const rows = await open.rows(); // once
const stop = db.live(open, draw); // and again after every write it readsA write reads the row it writes, and can be made to find it, saying why
when it does not. Sent as one /batch, a debit that finds too little money
is refused (412, unmet, "at": 0, "reason": "insufficient funds") before
the credit runs, and a credit to an account that is not there ("at": 1,
"reason": "no account to credit") puts the debit back:
set accounts {balance: balance - $3} where name = $1 and balance >= $3 require 1 else 'insufficient funds'
set accounts {balance: balance + $3} where name = $2 require 1 else 'no account to credit'
Search is in the same query: the words ranked by BM25, a typo and a word half typed found, what matched marked, and how many results each brand has -- for a results page and its filter sidebar:
get products select name, highlight(name, "<mark>", "</mark>")
match name $1 fuzzy prefix
where price < 500
facet brand top 10, color
limit 20
And by meaning, where a field holds an embedding: near finds the nearest
rows, with a filter planned beside it:
create collection articles (
title text,
body text @text,
tags [text],
year int @hash,
embed vector<768> @hnsw(cosine, m=16, ef_construction=200)
)
get articles select title
where year >= 2024 and tags has "rust"
near embed $1
limit 10
Or both rankings at once: BM25 and the vectors each find their own candidates, and reciprocal rank fuses the two lists, so a document either one missed still counts:
get articles select title
match body $1
near embed $2
fuse
limit 10
Lexical recall and an exact vector reordering on top of it — the second stage reads the stored vectors, so this path needs no HNSW graph at all:
get articles select title
match body $1
rerank embed $2 candidates 500
limit 10
fennecdb makes sense when the database should run beside the code that uses it — in the browser, in the process, or as one small server — and search belongs in it rather than in a second system: an app whose screens follow its data and keep it offline, a server many clients read and write that usually needs no cache in front, a service with a file per tenant in one region or several, and search over its own rows, a store's, a docs site's or an agent's memory. The scale limit is the indexes fitting in memory: the documents stay in the mapped file, so a server's memory follows its indexes, not its data (Limits).
SQLite when you need relational data, SQL with JOINs and a mature toolchain. Also in very short-lived processes: for a tool that runs fewer than five queries and exits, fennecdb's open cost never amortises.
PostgreSQL (with pgvector for vectors) for multi-writer systems shared
over a network that need ACID. On maturity, concurrency and ecosystem the comparison is not even
worth making — fennecdb is not aiming at that job. A table can move the
other way, though: fennec import copies one from PostgreSQL, and --follow
keeps it following the table's commits.
The numbers behind the comparison, and the method that produced them, are in
Benchmarks. On YCSB's
workloads in process, fennecdb does B with 16 threads at 545 k operations a
second against SQLite's 47.9 k, and C on one thread at 438 k against
279 k, its file compacted on its own as updates grow it (YCSB);
over HTTP, fennec-server does B at 16 clients, durable, at 18.2 k against
PostgreSQL's 13.0 k, both in Docker. At a million vectors it answers the
nearest ten at 99.1% recall in 0.141 ms, against pgvector's 98.6% in 2.076
(At scale).
A first query in a few commands: Quickstart starts the server and writes two rows, and in the browser there is no server at all. The download page picks the command for your machine; every way to install is on Install. From a clone instead (Build from source):
git clone https://github.com/fennec-db/fennecdb && cd fennecdb
make test # the Rust suite, then the JS suite
make serve # builds the wasm and serves the browser console on :8787Examples: one small app, Notes, in every language -- the browser, React, Node, Python, Go, .NET, Rust, SwiftUI, Jetpack Compose and Flutter -- each a folder to open and run, with a live list, filters, and full-text and vector search.
Binaries. fennec, the shell, and fennec-server, the HTTP server, for macOS
and Linux on arm64 and x86_64, and Windows on x86_64 and arm64 from the release
after 0.1.12 (the image runs anywhere):
brew install fennec-db/tap/fennecdb # Homebrew
curl -fsSL https://fennecdb.com/install.sh | sh # ~/.fennecdb/bin, no sudo
sudo apt install ./fennecdb_X.Y.Z-1_amd64.deb # or: sudo dnf install ./fennecdb-X.Y.Z-1.x86_64.rpmirm https://fennecdb.com/install.ps1 | iex # Windows: %LOCALAPPDATA%\fennecdb\bin, no administratorThe scripts download the release from GitHub and check the tarball, or on
Windows the zip, against the release's SHA256SUMS before they unpack it;
they touch no shell startup file, profile or PATH, only print the line to
add. Read them first with curl -fsSL https://fennecdb.com/install.sh | less
(site/install.sh, site/install.ps1).
The Windows programs are not signed, and need no Visual C++ runtime beside
them. The .deb and .rpm are attached to
each release after 0.1.11, for amd64 and arm64, with their checksums in
SHA256SUMS. Install has each of them,
and the tarball, the image and the language packages too; the tap's formula is
packaging/homebrew.
The studio app (beta), fennec studio as an app with its own server for each file, on macOS with Apple silicon, Windows and Linux (x64 and arm64; glibc 2.38 and WebKitGTK 4.1), unsigned:
curl -fsSL https://fennecdb.com/install.sh | sh -s -- --app # macOS: ~/Applications; Linux: ~/.local/share, a menu entry; no sudo& ([scriptblock]::Create((irm https://fennecdb.com/install.ps1))) -App # %LOCALAPPDATA%, a Start-menu shortcutor the release's fennec-studio-vX.Y.Z-macos-arm64.dmg, dragged onto
Applications, whose first open a browser's quarantine holds to System
Settings' Open Anyway; fennec-studio-vX.Y.Z-windows-x64.zip, whose first
start from a browser's download SmartScreen holds to Run anyway; or
fennec-studio-vX.Y.Z-linux-x64.tar.xz (-arm64 for both), each a folder
that runs where it is unpacked (the app).
Shell. Installed as above, fennec data.fennec; from a clone,
cargo build --release -p fennec-cli, then:
./target/release/fennec data.fennec # interactive
./target/release/fennec data.fennec -c 'get docs limit 5'
./target/release/fennec --read-only data.fennec # a server's file, read beside itThe shell holds data.fennec.lock while it has the file open, as the server
does, and a --dir node each tenant's it has open: a file a server, a node, an
agent's session, an app or another shell has open is refused, its holder named,
since two processes writing one file corrupt it.
The shell has a first session and its flags.
Browser. Dependency-free ES modules and the wasm file beside them:
import { Fennec } from './fennec.js';
const db = await Fennec.open('./fennec.wasm');353 KB of gzipped WebAssembly and an 88 KB gzipped client — no wasm-bindgen, no
build step. An app whose queries run on a server can import
@fennecdb/web/client, 12 KB brotli in its bundle, which cannot pull in the
engine, sync or storage (which package). With live
queries (db.live, React's useLiveQuery) it can be an app's whole state,
no server: state in the page. Quickstart: in the browser · JavaScript client.
Server. fennec-server serves a file, or a directory of tenants, over
HTTP and JSON: REST routes, FennecQL through POST /query, all-or-nothing
/batches, subscriptions over SSE and change data capture. Every language
reaches it with its own HTTP client
(languages), and these have a client
of their own, each its standard library alone:
| Language | Package | From |
|---|---|---|
| Python | pip install fennecdb (with the LangChain and LlamaIndex stores) |
integrations/python |
| JavaScript | npm install @fennecdb/web (connect) |
web/ |
| Go | go get github.com/fennec-db/fennecdb/integrations/go |
integrations/go |
| .NET | dotnet add package FennecDb |
integrations/dotnet |
make server TOKEN=secret
curl -H 'Authorization: Bearer secret' -d '{"query": "collections"}' \
http://127.0.0.1:8080/queryOne process writes a file -- two opening one would corrupt it -- so
replication, the graph keeper and the mirror are threads of it. A second
fennec-server follows it as a read replica with --replica-of: it is sent
the writes on the primary's disk, serves reads, refuses writes with 403, and
is promoted by hand; fennec backup, fennec archive and fennec restore --to <time> take a running database whole, keep its writes, and rebuild it as it
stood at a moment -- with --tenants, every tenant of a --dir node over
one connection. With --follow postgres://...?sslmode=verify-full it
mirrors a PostgreSQL table into its file as the table commits, over TLS,
and serves the mirror while it follows. Server ·
HTTP endpoint ·
Replication.
Past one machine, a --dir node holds a file per tenant and fennec-shard
routes each request to its tenant's node, gives each tenant a replica on
another node, and fails a node over on a lease. Nodes have a region and a
zone: a tenant lives in one region, its replica in another zone of it, and
a region may keep its own directory, so it leases and fails over its own
nodes while cut off from the rest. One Cloudflare Worker in front gives
every tenant one URL, and a tenant's read replica in another region answers
the reads a client there marks, which would each pay the trip home
otherwise (Frankfurt to Singapore is 158 ms), never from before that
client's own write. deploy/ is the kit to run it on machines of your own
-- systemd units, alert rules and the operator's runbook -- and make drill
kills a node and a router of a two-region deployment in Docker and checks
that no acknowledged write was lost; make chaos breaks a region at random,
seed by seed, and holds every read and write to a register checker and every
answered write to a ledger.
Tenants and sharding ·
Regions ·
One URL for every region ·
Read replicas ·
Deploying it.
Container. 8.62 MB on amd64, and the Dockerfile is two-stage: static
musl build into scratch, so the runtime image holds the binary and nothing
else — no shell, no package manager, no libc. The figure is that binary's, as
CI measures it on every change. It serves as 65534:65534 on whatever
volume a platform mounts: started as root, the server hands a root-owned
volume over and drops root itself
(Who owns the volume).
docker pull ghcr.io/fennec-db/fennec-server:0.2.0 # published, multi-arch
export TOKEN=$(openssl rand -hex 32) # past loopback a token is 32 bytes at least
make docker && make docker-run TOKEN=$TOKEN # or build it yourselfMobile and native apps. The engine as a native library
(crates/fennec-ffi, a C ABI) keeps the database in a file on the device:
Swift for iOS and macOS, Kotlin for Android and the JVM, Dart and Flutter,
each with the query builder and live queries driving the UI, and C on Linux
from the release's library. The file can be
a replica a server keeps in step -- reads local, writes optimistic and
queued while offline, over the platform's own HTTP client and its TLS -- and
Fennec.connect asks a server with no file at all.
| Language | Package | From |
|---|---|---|
| Swift | SwiftPM: github.com/fennec-db/fennecdb, product FennecDB |
integrations/swift |
| Kotlin | com.fennecdb:fennecdb-android (the AAR), com.fennecdb:fennecdb (the JVM) |
integrations/kotlin |
| Dart | flutter pub add fennecdb_flutter, or fennecdb in Dart alone |
integrations/dart |
| C, on Linux | the release's fennec-ffi-vX.Y.Z-<arch>-unknown-linux-gnu.tar.gz (x86_64, aarch64; glibc 2.34+): libfennec_ffi.so, libfennec_ffi.a, fennec.h and pkg-config's fennec-ffi |
crates/fennec-ffi |
let db = try await Fennec.open(path: path)
let open = try await db.from("todos").where("done", false).rows(as: Todo.self)
let live = LiveQuery(db, try db.from("todos").where("done", false), as: Todo.self) // for SwiftUI
// The same, a replica the server keeps in step: the one line that changes.
let db = try await Fennec.sync(url: "https://api.example.com", token: jwt,
shapes: [Shape("todos", key: "key")], path: path)Embedded in Rust. fennec-core is the engine as a library:
Embedded Rust.
| Documents | insert (refuses a taken id), put (upsert), set and del by filter, a batch landing whole |
| Atomic batches | POST /batch and the browser's run of several statements land whole or not at all; an Idempotency-Key makes a write once · the JavaScript, Python, Go, .NET, Swift, Kotlin and Dart clients send a request again only where it ran nothing (a 503 or 429 naming its wait, after it) or may run twice (a read the builder made or sent near, a write under a key), and give a request up at a timeout to its answer's head or between its pieces (Retrying a write) · optimistic concurrency by HTTP's own headers: GET /<name>/<id> answers the row's ETag, and a write under If-Match is made only over the row tagged, else 412 (Optimistic concurrency) |
| Live state and sync | a query a screen follows: a write runs again every live query reading what it wrote (db.live, useLiveQuery, SwiftUI observables, Flows, Streams) · a replica in the page or the app that reads with no network, queues its writes in its file and sends each once under an Idempotency-Key, the server owning the data (Sync) · a 401 hands the replica's token provider why -- an expiry the server names (token_expired), no token sent, the asks in a row -- so it asks its issuer for a fresh token and goes on, a token refused again asked for after 1 s doubling to 60 s, and signs out only where the issuer refuses, the account's replica and its unsent writes kept (Expiry) · a long seed sent in parts the server never holds whole and the replica shows only once the last came (A seed in parts) |
| Schema | alter collection adds, drops and renames a field without rewriting a document |
| Schema in code | tables declared in TypeScript Drizzle's way, or a schema.fennecql in any SDK, checked at every open: what only adds is applied, a drop, a rename or a type change refused until a migration says, run once and recorded; fennec types writes TypeScript, Python, Go or C# from a database or a schema file |
| Types | bool int float text bytes timestamp [type] json (objects, lists and scalars; a path such as meta.source.rank reads into it in where, select, order and set; imported from PostgreSQL's jsonb) geo (a point, [lon, lat]; imported from PostGIS) vector<N[, f16]> sparse<N> |
| Indexes | @hash, @unique (a second document holding a value refused, null aside), @sorted, @sorted(a, b desc) and @unique(a, b) over several fields, @ttl(30m), @text(k1=.., b=.., prefix=..), @geo, @hnsw(metric, m=.., ef_construction=.., ef_search=.., quant=int8|bit), @inverted; @text beside a field's @hash, @unique or @sorted (email text @unique @text); @hash, @unique and @sorted on a path into a json field too |
| Operators | = != < <= > >=, ~ (text contains, case-insensitive), has (list contains), in [..], in $1 (one parameter holding the list, up to 100 000 values; SQL's = ANY($1)), in (get ...) (another collection's rows, run once, up to 100 000 values), is null, between, like and ilike |
| SQL's spellings | CREATE TABLE and CREATE INDEX (types as fennec import maps them), INSERT INTO … VALUES, UPDATE … SET a = …, JOIN and LEFT JOIN on a key (a lookup, answered flat), IN (…), EXISTS, DISTINCT, BETWEEN, LIKE and ILIKE, ON CONFLICT, pgvector's ORDER BY emb <=> $1, single quotes and || read as the FennecQL they mean, through every client; what would answer otherwise refused with the FennecQL to write (From SQL) |
| Aggregates | count(*) sum avg min max, whole or per group, ordered and paged by any of them |
| Relations | lookup — a collection's matching documents attached per row, limit counted per parent, keyed by one field or several (on (org, order) = (org, id)), chainable to 8 levels |
| Expiry | seen timestamp @ttl(30m) — a row gone that long after its time: out of every read at once, deleted by the server's sweeper as ordinary deletes |
| Collation | order name collate und — Unicode's order for every script, as ICU's root orders it (PostgreSQL's und-x-icu); collate tr Turkish (ç after c, ı before i, tr-x-icu); a field declared in one pages by its last row; bytes otherwise |
| Case-insensitive text | email text nocase @unique — compared by its Unicode case fold wherever it is compared (=, its indexes, order, group, facet), kept as written, PostgreSQL's citext; Turkish's I/ı and İ/i under collate tr |
| Text search | match ranked by BM25 over @text, or a filter beside order, count and aggregates (the matches newest first, how many) · fuzzy for a word typed wrong and prefix for one half typed · highlight() and snippet() marking what matched · facet counts beside the page, disjunctive and by ranges · a word typed without accents finding it written with them, and @text(accents) keeping Vietnamese's tones apart · Chinese, Japanese, Korean and Thai split into runs of characters |
| Places | distance(loc, p) <= 500 and within(loc, [w, s, e, n]) over a geo field, through @geo, nearest first with near (in metres) — Redis's GEOSEARCH, the metres its GEODIST's (Points and distances) |
| Instead of Redis | counters (set c {n: n + 1}), rate limits (fixed and sliding windows, token buckets), locks with fencing tokens, sessions and caches under @ttl, leaderboards, sets, HyperLogLog, job queues with leases and a claim held until a job comes, delayed jobs, streams, pub/sub, idempotency keys — each a statement or two a test runs; no LRU eviction, no Lua (Instead of Redis) |
| No cache in front | the file is mapped, so the operating system keeps the pages in use in memory and fennecdb copies none into a buffer pool of its own: a separate cache in front of fennec-server is usually unnecessary while the working set fits in memory. On YCSB in Docker against Redis 7.4, the same durability mode against the same, Redis does more operations a second in none of the 33 cells measured both ways (A to F at 1, 4 and 16 clients, durable and buffered; C, which writes nothing, buffered alone): fennec-server's C at 16 clients, buffered, is 18.4 k against Redis's 14.0 k, and its B, durable, 18.2 k against 9.25 k (one node over Docker's network, 1 KB records; a cache nearer the app than the database is not measured; about a database's reads, not an HTTP or CDN response cache — the figures and their conditions) |
| Functions | lower upper len coalesce now timestamp cosine l2 dot norm normalize distance within + plugins |
| Vector search | near over vector<N[, f16]> (HNSW, with int8 and bit codes; exact by dot product over a sparse<N> such as SPLADE's), by cosine, l2 or dot · rerank (exact vector reordering of match candidates, no graph needed) · fuse (match and near ranking together, by reciprocal rank) |
| Interfaces | FennecQL · a query builder in seven languages · REST/JSON + SSE, described by an OpenAPI 3.1 document the server serves (/_openapi.json: Swagger UI, any OpenAPI generator) that only grows, a route on its way out answering Deprecation and Sunset first, with HTTPS built in in the server and the router (--tls-cert, --tls-key), no proxy in front, and dialed too: a replica's primary, the router's nodes and regions, the OTLP exporter and the MCP bridge take https:// URLs, held to Mozilla's roots or to --tls-ca's (Dialing HTTPS) · answers in gzip to a client across the network that asks for it, a seed's stream too, by a compressor of its own (5 to 6 times smaller, a 100 000-row seed in 0.6 s rather than 2.6 at 50 Mbit) · WASM C ABI · a native C ABI for apps, built for Linux on each release (x86_64 and aarch64, glibc 2.34+: the shared and static library, fennec.h, pkg-config) · change data capture (/_changes, every write on disk as a JSON line, resumable) · import from SQLite and PostgreSQL, over TLS checked as libpq's sslmode says -- verify-full by default for a host off this machine -- signed in by SCRAM-SHA-256 bound to the TLS session (Import) |
| Agents | an MCP server (fennec-server --mcp, fennec mcp over stdio): schema, search (words, an embedding, or both fused), query, get, and write and a memory (remember, recall) where asked for, and a call_<name> tool for each named statement the token may call, typed by its signature, held to the token's rules |
| Integrations | useLiveQuery for React, over a database in the page or a synced replica · SDKs for Python, JavaScript, Go and .NET · embedded in Swift, Kotlin and Dart/Flutter apps, live queries as SwiftUI observables, Flows and Streams · LangChain and LlamaIndex vector stores, each passing its framework's own tests |
| Access | a server token · HS256, RS256 and ES256 JSON Web Tokens (JWKS, rotated by kid) held to the issuer and audience you name and to a policy, down to the rows (owner = $jwt.sub, a provider's own claims such as $jwt."cognito:groups") and the fields each row shows · each user held to 1 000 requests a second on every route, told when to come back (--request-rate) · a refused token waiting longer each time, by its address (an IPv6 one by its /64), and every token taken past loopback 32 bytes at least · a server with no token answering only this machine's name and its own pages, so neither another site's page nor a rebound DNS name reaches it, straight or through the router, and no router listening past loopback forwards to it (unless both say --insecure) · an audit log of refusals, schema changes and admin actions |
| Named statements | a block of FennecQL defined once in the database and called by name with typed arguments (call transfer {from: 1, to: 2, amount: 300}, SQL's CALL): one block under the write lock where it writes, a read beside the others where it only reads -- answered by replicas, read-only servers and reads marked for a read replica -- run with its own text's authority, so a token granted transfer call needs no write rule on the accounts it moves; called by its path (POST /_call/transfer) or through /query and /batch, the shell and the native library, or the call method of every SDK (db.call('transfer', {from: 1, to: 2, amount: 300}); Dart's callStatement; read sends a statement that only reads to a read replica), an agent's call_transfer MCP tool, or the studio's call form, held by Fennec-Wait like the writes in it, and declared in a tenant's schema at the router (Named statements) |
| Statements bound to writes | a named statement bound to a collection's writes (create statement paid_ledger after set orders where new.status = 'paid' and old.status = 'open' as ...) runs once a row, in the block of the write that woke it: a ledger line, a counter or a denormalized field landing with the write that made it, so a crash, a replica and a subscriber see both or neither · a guard's require ... else '...' refuses the write, its writer told the reason, the server's token the binding's name too (binding), and a scoped token's write wakes one only where its policy grants wake · every SDK's error carries binding (FennecError.binding and its kin), and fennec studio lists a collection's bindings beside it · counted (fennec_bound_runs_total, fennec_bound_refused_total, the shape after paid_ledger in /_stats/statements), named in the slow-statement line, the traces and the audit log, and listed beside its collection in GET /_schema, in statements and in describe statement · a synced replica sends the write alone and the rows it derives come back through a shape (Statements bound to writes, in the sync, watching them) |
| Scheduled statements | a named statement run by the clock on a file's server or a tenant node (create statement lapse_holds every 1m as set holds {state: 'lapsed'} where until < now() ..., at '0 3 * * 1-5' in 'Europe/Berlin'): each run and the mark of the slot it ran for land as one block, so a crash or a replica sees a slot run once or not at all, and a server down for a day runs the latest slot once · now() the run's start and slot() the slot's instant · a refusal the statement makes spends the slot, the quota or a storage error holds it for a retry · defined and called by hand by the server's token alone, a missing statement to every scoped one · a node opens an idle tenant as its slot comes and closes it after, a run from each tenant due before a second from any · watched: the listings show each schedule's next slot, last run and held slot, and a run is counted in /_metrics and /_stats/statements, named in the slow line and traced · every SDK lists them with their clocks (db.statements()), and fennec studio shows each and runs one now (Scheduled statements, on a node, watching them) |
| Webhook consumers | another service's events taken by a named statement at POST /_hooks/<hook> (create statement stripe_paid($intent text from event.data.object.id, ...) on hook stripe where event.type = 'payment_intent.succeeded' as set orders ...): Stripe's, GitHub's and every Standard Webhooks sender's signatures (Svix's, and Clerk's and Resend's through it) checked before anything of an event is read, every failure before them one 401 whose check only the log, the audit line and /_metrics name · taken once by its key, the statements' writes and the key one block, a retry or a duplicate answered as the first · answered 2xx only once on disk whatever --sync says, and once a replica a promotion could take it from holds it · the secrets in a hooks file (--hooks), two while one rolls, never the database's · each tenant of a node at /t/<tenant>/_hooks/<hook>, behind the router and the global entry, its secrets beside its file, set through the router and carried to its standby, through a move and a failover, never the directory's · defined by the server's token, a missing statement to every scoped one · watched: listed with its hook and whether a secret arms it in fennec studio and every SDK (db.statements()), sent a test event from the studio or any SDK's call, counted by outcome and as hook <name> among the statements' shapes, on the slow line and as a span a statement, with Datadog monitors (Webhooks from Stripe and GitHub, watching them) |
| Backend recipes | what a backend platform bundles, done with fennecdb and a standard service and each run against a real server: sign-in from your identity provider · files in S3 or R2 behind links the rules decide · functions and webhooks on a write (a Worker, a job queue, a consumer of the change stream) |
| Operations | read replicas and promotion · archives and backups sealed with a key, restored to a moment, every tenant of a node over one connection · every record of the file checksummed: an open after a power cut cuts only what no completed sync covered and refuses damage below it, and fennec verify data.fennec checks every record (file format) · a file per tenant behind a router, failed over on a lease, a replica that did not take tried again and the tenants left without one counted (replicas of their own) · under --sync always a failover loses no write its standby was sent, and a standby not connected or behind is watched before it matters: counted on its node, alerted on by the kit, and each promotion answers and logs how far behind its copy was (watching a standby) · a slow client held to its request's time on a node and the router alike: 10 s from its first byte and a second more for each KiB that came, so a slow mobile link's upload goes through and a trickle is cut, an answer it stops reading let go, each counted in /_metrics (limits) · rolling upgrades, every reader before any primary, each release run beside the last one's server and shell (its router built from its tag's sources: no release publishes one) both ways, under writes (Compatibility and upgrades) |
| Regions | nodes in regions and zones, a tenant's replica in another zone of its region · a region keeping its own directory, leased and failed over by its own router while cut off (its own directory) · one URL for every region: a Cloudflare Worker that learns each tenant's home from the routers and names each client to them under an HMAC, so a refused token waits by the client's address (global entry) · read replicas in other regions: the reads a client marks, through any SDK (reads: 'nearest' in JavaScript), answered near it and never from before its own write, a subscription sent after that write waiting for it too, and a JavaScript live query's runs after each change its stream at home tells of (read replicas) · a kit to run them: systemd units, alert rules, a runbook and a failover drill (deploy/) |
| Runs on | Linux and macOS, arm64 and x86_64 · Windows 10 and 11 and Windows Server 2016 and later, x86_64 and arm64, the file mapped and made durable as on a Unix, from the release after 0.1.12 (install.ps1) · the image wherever Docker runs · the browser (WASM), its database kept in IndexedDB or a file of the origin's and held to what it keeps in Chrome, Firefox and Safari, the page reloaded in the middle of a write (Keeping a database) · iOS and Android, in the app (Install) |
| Monitoring | /_metrics for Prometheus — statements and their latency per transport, data, replication — a Grafana dashboard, --slow-ms, and OpenTelemetry traces over OTLP (--otlp-endpoint) |
| Studio | fennec-server --studio: collections, rows, edits, a query editor, the schema, live rows and the server's numbers in a browser at /_studio/, with the token you paste and no authority of its own · an app (beta) for macOS on Apple silicon, Windows and Linux (install.sh --app, install.ps1 -App, or the release's DMG, zip or tarball, unsigned: integrations/studio-desktop) that makes, opens, serves and backs up .fennec files: a served database's port, reach and token (kept in the Keychain) picked in a sheet, its server stopped with the app; saved servers and their tokens in the Keychain |
| Runtime size | 353 KB gzip wasm + 88 KB gzip client, or the client alone (@fennecdb/web/client) · 2983–5027 KB binary, x86-64 Linux as CI measures it · 8.62 MB container image |
Full reference: FennecQL.
What it deliberately does not do — no second writer (a batch holds the
database from its first write to its end), no interactive transactions, no
SQL dialect (SQL's everyday spellings are read as FennecQL) and no PostgreSQL
wire protocol, no join of arbitrary conditions (a JOIN on an indexed key is
a lookup, and an uncorrelated in (get ...) a filter),
no change of a field's type in place, no multi-writer replication, no decimal
type — is listed with its reasoning in Limits, alongside every
ceiling baked into the code. Relations are lookup, which attaches a
collection's matching documents to the row they belong to with a limit that
counts children per parent, and chains — products → reviews → authors is one
query; it is not a join and is not trying to be one.
| Quickstart | Start the server, write two rows, query and search them with curl and from your language, and see them in the studio |
| Quickstart: in the browser | The database in a page with no server: a Vite project, one npm package and a script, then kept in IndexedDB |
| Install | The install script, Homebrew, a .deb or .rpm, a tarball, the image, a package for each language, or a build from source |
| The shell | fennec: open a file, run FennecQL a statement at a time, script it, and import, back up and generate types |
| Build from source | Clone, build the shell, the server and the browser module, run the tests and build the site |
| How it works | Segments, the offset index, the mapped file, why there is no buffer pool of its own and exactly one writer, and HNSW with a filter |
| FennecQL | A tour from the first write to a lookup and a total, the grammar, and a reference page for each family of statements: reading, writing, collections and types, indexes, lookup and subqueries, aggregates, text search and vector search |
| From SQL | The SQL FennecQL reads as written — tables, joins, subqueries, pgvector's distances — what it refuses and what to write instead, where the meaning is not SQL's: nulls, double quotes, text, joins |
| JavaScript client | The browser client, the immutable query builder, binding it to a transport, live queries as an app's state, a schema declared in code |
| Mobile and native apps | Swift, Kotlin and Dart/Flutter: a file on the device, the builder, live queries driving the UI, syncing with a server, TLS and the background, where the file lives, durability |
| HTTP endpoint | Start a server and send it FennecQL from curl or any language's standard library: REST/JSON derived from the schema, raw FennecQL, batches, writes safe to retry, writes held to the row they read (If-Match); then the reference (every route, filter, header and status, SSE, vector search over POST, a read marked for a replica) and security and scoped access |
| Server | Running fennec-server: flags, HTTPS, durability, tokens and policies, the audit log, limits, containers |
| Cloud platforms | Deploying fennec-server on Fly.io, Render, Railway, a VM on AWS, Google Cloud, Azure, DigitalOcean, Hetzner and others, and Kubernetes (EKS, GKE, AKS), or no server at all with a database in each Cloudflare Durable Object; the platforms that cannot hold the file, and using it from apps and serverless functions (Vercel, Netlify, Lambda, Cloud Run) |
| Replication | Read replicas fed the writes on the primary's disk, promotion by hand, what a failover loses, backups and restoring to a moment, every tenant of a node archived over one connection |
| Integrations | useLiveQuery for React, the Go and .NET SDKs, and LangChain and LlamaIndex vector stores over HTTP |
| Agents and MCP | An agent's search and memory over the Model Context Protocol: fennec-server --mcp and fennec mcp for Claude Code, Cursor and Claude Desktop, each tool held to the token's rules, answers past a bound refused rather than cut |
| Monitoring | /_metrics in Prometheus's format, the Grafana dashboard in monitoring/, the slow-statement log and a request id in every line |
| Datadog and others | The Datadog Agent's check, logs pipeline and dashboard in monitoring/datadog/; New Relic, Elastic and Grafana Cloud |
| Grafana | The server's metrics through Prometheus and the database's own rows through fennecdb-datasource (integrations/grafana), each panel FennecQL with the time range and variables bound as parameters, alert rules included, under a read-only token; or through the Infinity plugin; the dashboards in monitoring/ |
| Sync | A local replica that reads without the network and writes optimistically |
| Instead of Redis | The patterns an app adds Redis for, each with its recipe — counters, rate limits, locks with fencing tokens, sessions, caches, leaderboards, sets, unique visitors, delayed jobs, streams, pub/sub, idempotency keys — and what fennecdb does not do that Redis does |
| Job queues | Claims under a lease, acks, retries with a backoff, dead letters, delays and priorities, and a claim held at the server until a job comes |
| Auth with your identity provider | Clerk's, Auth0's, Supabase Auth's, Cognito's, Firebase's or Cloudflare Access's tokens held to a policy down to the rows and fields: what the server checks and what it does not, the keys kept fresh, the issuer and audience that hold a token to your application, claims by name in a rule, a tenant claim, a run |
| Files with S3 and R2 | The bytes in an object store and the facts in a collection: presigned upload and download links (an insert for an upload, a read for a download), the object deleted by a consumer of the change stream when its row goes, orphans reconciled, and why the bytes stay out of the file |
| Webhooks from Stripe and GitHub | Another service's events taken by a statement: a hooks file, Stripe's payments, GitHub's pushes, a Standard Webhooks sender's events, every answer a sender is told, the one 401 and where its check is read |
| Functions and webhooks | Reacting to a write with no code in the database: a Worker as an endpoint, a job queue, a signed webhook from the change stream, and when each fits |
| Points and distances | A geo field: distances in metres, rows within a radius or a box, the nearest first, positions that expire |
| Analytics and market data | Rollups by the minute, distinct users, funnels and retention over events; bars, VWAP and the latest price over ticks |
| Tenants and sharding | A tutorial that runs a router and two nodes and fails one over, then a guide to tenants (schema, quotas, moves, archives, queries across them), replicas and failover, regions, the global entry and read replicas, the reference and the design |
| Deploying across regions | deploy/: systemd units for nodes, routers, archivers and the tunnel, alert rules, the operator's runbook, make drill, which kills a node and a router of a two-region deployment in Docker and checks no acknowledged write was lost, and make chaos, seeded random faults -- kills, pauses, netem delays, losses and partitions, failovers during moves -- held to a register checker and a ledger of every answered write |
| Import | Build a collection from SQLite or a live PostgreSQL server in one command, and keep it following the table's changes |
| Embedded Rust | fennec-core as a library: opening a file, executing parsed statements |
| File format | One file, replayed in a single pass; record kinds, and the crate layout |
| Benchmarks | An overview and a page for each family: YCSB against SQLite, PostgreSQL, MongoDB and Redis, writers beside readers and a request over HTTP, text search; then vectors, against SQLite and pgvector in process and fennec-server against pgvector at scale, and sizes and memory |
| Limits | What it does not do, every hard-coded ceiling, memory and scale |
The docs are the long-form reference; their source is
site/content/docs/, so a correction is a pull request
like any other.
Coding agents get the same docs as text, rendered from those pages on every
build: llms.txt is a brief with the rules
FennecQL does not share with SQL, and
llms-full.txt is every page in one file.
To report a vulnerability, privately, see SECURITY.md: what is
in scope, the supported versions and the acknowledgement within 3 working days.
The threat model lists every trust boundary with
the code that enforces it, the test that proves it and what it does not
defend; no outside audit has been made, and the scope one would take is
kept there.
CONTRIBUTING.md has the setup, the narrower test invocations and the
invariants a change must not break.
Apache-2.0. See LICENSE.