One element. Thousands of isolated atoms.

Open sourceAGPL-3.0Pure Rust

Isolated disposable databases. For tests, CI, and AI agents.

MongoDB-compatible local server with O(1) copy-on-write database branches and auto-expiring TTLs. One process, hundreds of branches, no Docker.

curl -fsSL https://raw.githubusercontent.com/nhrbuilds/kryptondb/main/install.sh | bash

One process. Hundreds of isolated branches.

O(1) Copy-on-Write Branches

Shares unchanged documents and secondary indexes from a template database across hundreds of isolated branches in one process.

MongoDB Wire Protocol

Speaks OP_MSG 2013 over TCP or local socket so mongosh and existing MongoDB drivers connect without wrappers.

Sliding Idle Branch TTLs

Set --ttl 30m or --ttl 2h so abandoned test or AI agent branches expire automatically while active work stays alive.

Indexes, Aggregations & Streams

Supports secondary indexes, multi-document transactions, $changeStream, GridFS, Decimal128, and TTL indexes for supported commands.

Hard Memory Guardrails

Enforce --mem-limit-db, --mem-limit-runtime, and --rss-limit-mb ceilings so runaway suites never exhaust host RAM.

Zero-Docker Single Binary

Built in pure Rust with checksum-verified installers for Linux, macOS, and Windows - no container daemon needed.

Instant branches. Fraction of the RAM.

Local branch fan-out lifecycle measured on a 10,000-document fixture with tenant_1 index vs standalone MongoDB 8.3.9 ($out + index copy).

0.64 msSingle branch creation
4.1×Faster 100-branch lifecycle
830 testsWorkspace suite passing

Concurrent Fan-out Lifecycle

Median of 3 runs · branch creation + write + cleanup

BranchesBackendCreateTotal
1KryptonDB0.64 ms5.12 ms
1MongoDB36.62 ms41.39 ms
10KryptonDB2.57 ms39.48 ms
10MongoDB105.5 ms138.53 ms
100KryptonDB22.71 ms379.35 ms
100MongoDB1196.94 ms1537.21 ms

Full Lifecycle Duration & RSS

Total elapsed time and process RSS delta per fan-out

1 branch lifecycle · RSS 0.0–0.1 MiB vs 4.6–16.8 MiB
KryptonDB
5.1 ms
MongoDB
41.4 ms
10 concurrent branches · RSS 0.0 MiB vs 34.4–125.4 MiB
KryptonDB
39.5 ms
MongoDB
139 ms
100 concurrent branches · RSS 0.0 MiB vs 415.2–888.5 MiB
KryptonDB
379 ms
MongoDB
1,537 ms

Same-host evidence on Linux (KryptonDB 1.0.0 vs mongod 8.3.9 with PyMongo 4.18.2); not a general MongoDB throughput claim or production capacity guarantee.

Works with your existing MongoDB driver & CI.

kryptondb branch prints a standard mongodb:// connection string you hand straight to mongosh, Node.js, Python, Go, or Rust drivers.

branch-uri
BRANCH_URI="$(kryptondb branch app test-1 --ttl 30m)"

Prebuilt binaries for Linux, macOS, and Windows PowerShell - no Docker or Rust toolchain required.

ci-branch.sh
#!/usr/bin/env bash
set -euo pipefail

# Spin up an isolated branch per parallel test worker or agent
branch="worker-${TEST_WORKER_ID:-01}-$$"
uri="$(kryptondb branch app "$branch" --ttl 30m)"

cleanup() {
  kryptondb drop "$branch" >/dev/null 2>&1 || true
}
trap cleanup EXIT

MONGODB_URI="$uri" npm test

Community-backed open source.

Voluntary backing only. Approved manually before listing. Dollar amounts stay private.

No public sponsors yet - be the first supporter below.

View tier durations & sponsorship rules
TierMonthlyYearlyOne-TimePlacement Duration
Gold Sponsor$250+ / mo$2,500+ / yr$500+ onceLarge logo card + tagline + link while active (or 180 days for one-time), then permanent supporter credit.
Silver Sponsor$50+ / mo$500+ / yr$100+ onceMedium logo card + link while active (or 90 days for one-time), then permanent supporter credit.
Bronze Backer$15+ / mo$150+ / yr$25+ onceCompact badge + link while active (or 30 days for one-time), then permanent supporter credit.
Supporter$5–$14 / mo$5–$149 / yr$5–$24 onceListed directly in the permanent compact supporters strip with name and link.

Pure Voluntary Support

Sponsorships fund ongoing maintenance, testing, and documentation. They do not buy custom features, SLAs, or priority roadmap control.

Manual Approval Before Listing

Every sponsorship enters review first and is never auto-published. We reserve the right to decline sponsors whose business conflicts with our ethical standards.

Privacy & Amount Confidentiality

Dollar amounts and contact emails are never shown publicly. Only your chosen display name, optional tagline, logo, and URL appear.

Cancellation & Refund After Fees

Recurring sponsorships stop featured placement when cancelled (moving to permanent credit if kept). Declined or admin-refunded entries receive a refund net of payment processor fees.

Release history.

Synced from CHANGELOG.md.

v1.0.0

Added

  • Verified install path across platforms: install.sh, install.mjs, and install.ps1 download release assets and verify their .sha256 sidecars before installing.
  • CODE_OF_CONDUCT.md, issue and pull request templates, and CODEOWNERS for public contribution workflows.

Changed

  • Version is 1.0.0 across the workspace, crate path dependencies, the npm package, and the README. The prior 0.1.0-beta.1 docs, roadmap, and support table now describe the 1.0.0 line.
  • The CLI and the driver-backed integration tests use the official mongodb 3.x driver. Its patched rustls 0.23 dependency clears the TLS advisories the 2.8 driver carried; cargo audit reports no vulnerabilities.
  • The license is declared with the SPDX id AGPL-3.0-only in the workspace and npm manifests.

v0.1.0-beta.1

Added

  • Expression operators: $toArray, $toObject, $toUUID, $tsSecond, $tsIncrement, $createObjectId, $hash, $hexHash and $toHashedIndexKey, with mongod 8.3.9's probed values, null rules and error messages. Query predicate $sampleRate completes the P2 operator set.
  • $changeStream.showExpandedEvents emits DDL events (create, createIndexes, dropIndexes, modify) with mongod 8.3.9's probed operation descriptions, in collection, database and cluster streams.
  • $text tokenization is mongod's own: the Unicode 8.0.0 delimiter property set (White_Space, Dash, Hyphen, Quotation_Mark, Terminal_Punctuation, Pattern_Syntax, STerm, apostrophe except English) and the generated diacritic map, including pure combining marks and non-Diacritic Mn code points.
  • $setWindowFields operators $expMovingAvg (N and alpha forms), $linearFill, $minMaxScaler and window $setUnion, plus $meta: "sortKey" / "indexKey" projections with mongod's shapes and errors.
  • OP_MSG wire behavior: moreToCome requests suppress the reply, exhaustAllowed (bit 16) streams tailable getMore batches flagged moreToCome, and checksumPresent is echoed only when requested and verified on input (CRC-32C).
  • Metadata and introspection stages: $collStats, $indexStats, $planCacheStats, $listSessions, $listLocalSessions, $listCatalog, $listClusterCatalog, $listSampledQueries, $querySettings, $queryStats, $currentOp, with mongod's namespace rules and honest empty shapes where KryptonDB keeps no such state.
  • 8.x fusion stages $rankFusion (weighted RRF over subpipelines), $score/$scoreFusion metadata handling, and $changeStreamSplitLargeEvent: events over 16 MiB fragment into metadata/fullDocument, fullDocumentBeforeChange and updateDescription parts with distinct resume tokens, and the stage must be last (7182802).
  • Command surface: bulkWrite, mapReduce (boa-backed map/reduce/finalize), listCommands, convertToCapped, cloneCollectionAsCapped, filemd5, dataSize, dbHash, hostInfo, getLog, getCmdLineOpts, validateDBMetadata, top, profile, lockInfo, connPoolStats, currentOp, killOp, setParameter, get/setDefaultRWConcern, setFeatureCompatibilityVersion, setIndexCommitQuorum and shutdown. serverStatus reports real process uptime (uptime/uptimeMillis since start, MiB memory) and collStats carries capped options, indexSizes, totalIndexSize, totalSize, scaleFactor, numOrphanDocs and freeStorageSize.
  • find options returnKey, showRecordId ($recordId), noCursorTimeout, allowDiskUse and the deprecated oplogReplay, matching mongod 8.3.9's probed shapes.
  • Process admin commands: fsync/fsyncUnlock with a real global write lock (writers wait, reads run, nested lock counts), dropConnections, logRotate, rotateCertificates, autoCompact, setUserWriteBlockMode (standalone's code 20), get/setClusterParameter (code 4 for every name), planCacheSetFilter/planCacheListFilters/planCacheClearFilters/planCacheClear with mongod's filter shape and exact validation errors, and setQuerySettings/removeQuerySettings with 8.3.9's IDL type checks and hash-parser replies. getAuditConfig, setAuditConfig, serverInfo, shardConnPoolStats and getQuerySettings are NOT commands on mongod 8.3.9 (probed 59), so they stay CommandNotFound.
  • Expression parity: the full trigonometry family ($sin … $radiansToDegrees), $sigmoid, $indexOfBytes/$indexOfCP, $replaceOne, with mongod 8.3.9's probed values, null rules, error codes and messages.
  • Decimal128 arithmetic matches mongod's BID128 rounding, double-to-decimal 15-digit view, large-coefficient exponent range and compensated $sum/$avg lanes.
  • MongoDB OP_MSG 2013 server (OP_QUERY handshake, hello/isMaster/buildInfo/ping).
  • In-memory CoW storage engine (im::OrdMap + HashMap in crates/kryptondb-core), forkDatabase O(1) branching, per-DB sharding.
  • CRUD: insert/find/update/delete/count/distinct/aggregate/getMore/killCursors with sort/projection/cursor pagination and single-field secondary indexes (createIndexes/listIndexes).
  • findAndModify with new, upsert, remove, sort, projection and driver-shaped reply.
  • Shared Router: TCP, UDS and the dashboard now use one process-wide engine, cursor store and watch registry.
  • watch: $changeStream at collection or database level, driver-shaped ns, operationType, updateDescription, document resumeAfter tokens, postBatchResumeToken, invalidate, and tailable getMore with maxTimeMS.
  • Snapshot reads via readConcern: {level: "snapshot"} + lsid: one atomic pin of all DBs per session.
  • Multi-document transactions over driver sessions: cross-database point-in-time snapshot, read-your-writes, atomic commit of the touched collections, idempotent commit, WriteConflict (112, TransientTransactionError) on concurrent writes, transaction-owned cursors closed on commit/abort, 60s janitor abort of abandoned transactions.
  • Query semantics: unknown top-level operators are BadValue (2); $nor, $all, $size, $elemMatch (document and operator forms), $regex with $options, $type, and field-level $not. Unsupported operators are rejected instead of silently matching nothing.
  • Extended update operators: dotted $set/$unset/$inc/$mul/$min/$max/$rename/$currentDate/$push/$addToSet/$pop/$pull/$pullAll/$bit, plus $setOnInsert. Modifiers ($each/$slice) and query-operator $pull are rejected explicitly. _id is immutable under every update operator and pipeline form (ImmutableField, 66).
  • TTL indexes (expireAfterSeconds) and TTL branches (forkDatabase ttlMillis, branch --ttl), runtimeStatus.
  • Capped collections (capped/size/max, 256B floor, synchronous FIFO eviction).
  • GridFS (fs.files/fs.chunks, 256KB chunks, auto-create siblings + files_id index).
  • Memory limits: run --mem-limit-db/--mem-limit-runtime/--rss-limit-mb, OutOfMemory (53200) on inserts and updates; per-collection 100MB hard ceiling.
  • CLI commands: branch/ls [--json]/url, fork --ttl, parse_ttl (2h/5m/30s/1d), bench.
  • aggregate wide stage count: $group accumulators $sum/$count/$avg/$min/$max/$first/$last/$push/$addToSet, $count, $unwind, $addFields, $replaceRoot; unknown stages 40324.
  • Lifecycle: explicit bind before advertising readiness, non-zero exit on bind/seed failure, stale-socket takeover that never clobbers a live instance, --no-socket and --port 0, graceful SIGINT/SIGTERM shutdown with UDS cleanup.
  • Release assets carry .sha256 sidecars; install.sh, install.mjs and install.ps1 verify them before installing.
  • SECURITY.md, docs/readiness.md, BRAND.md.

Changed

  • Bulk inserts use one prepared batch (insert_prepared_batch): index options listed once, BSON sizes computed once per doc.
  • estimated_bytes is maintained on every write (total_bytes) instead of rescanning documents.
  • Update replies follow MongoDB semantics: an upsert returns n:1, nModified:0, upserted:[{index, _id}]; a matched update returns n:1, nModified:1.

Fixed

  • Wire sessions: lsid/$db-first dispatch, endSessions, and killCursors work across all transports.
  • Change-stream initial getMore no longer returns nextBatch for a different namespace.
  • Secondary indexes: duplicate values preserved (OrdSet buckets); find count matches docs not keys; updates move entries.
  • Numeric key: Double(1.0) vs Int64(4607182418800017408) collision gone; unified IEEE-754 ordering -2 < -1.5 < 0 < 1 < 1.5 < 2; Int32/Int64/Double cross-type equality holds.
  • sort+skip+limit sorts then pages on both indexed and scan paths; Double(-1.0) is descending.
  • drop collection executes (was a no-op); unknown commands → CommandNotFound (59); $db/lsid-first dispatch honors.
  • >10k aggregates/counts via find_all_documents; distinct uncapped.
  • Cursor store: one shared store, TTL + 1000 cap + oldest eviction; OP_GET_MORE/OP_KILL_CURSORS round-trip; unknown opcodes emit an error frame (not a silent close).
  • Insert simultaneous race + upsert onto a missing DB now creates; GridFS chunk div_ceil + join ordering fixed.
  • commitTransaction/abortTransaction without a session return FailedToParse (9); unknown or stale transactions return NoSuchTransaction (251) instead of the non-standard TransactionTooHard.

Questions & answers.

Is KryptonDB a drop-in replacement for production MongoDB or Atlas?

No. KryptonDB is built specifically for temporary local development, automated tests, CI jobs, and AI coding agents. It implements a subset of MongoDB wire commands, runs in memory by default, and has no authentication or TLS.

How do template databases and copy-on-write branches work?

A template database holds your starting data and indexes. Running kryptondb branch <template> <name> sends forkDatabase to create a lightweight view (im::OrdMap + HashMap) that shares unchanged state with the template and only allocates memory where writes diverge.

Do I need Rust, Docker, or a separate Node wrapper to use it?

No. Prebuilt single-file release binaries install with one shell or PowerShell command and verify their .sha256 checksums. Connect with mongosh or any existing MongoDB driver over mongodb://127.0.0.1:27017/<branch>.

How do monthly, yearly, and one-time sponsorships work?

All sponsorships go through Whop and enter manual review before appearing publicly. Monthly and yearly sponsors stay in their tier slot while active; one-time sponsors receive a fixed featured window (30, 90, or 180 days by tier) before moving into the permanent compact supporters list.