MCPcopy Index your code
hub / github.com/dolthub/dumbodb

github.com/dolthub/dumbodb @v0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.0 ↗ · + Follow
3,380 symbols 18,892 edges 435 files 1,918 documented · 57%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Logo

What is DumboDB?

MongoDB and Git had a baby, and it's named Dumbo. It's a document database with built-in version control, so you can track changes, branch, and merge just like you would with code -- but for your data.

DumboDB leverages the power of the Dolt storage engine. Dolt's prolly trees enable efficient storage of data over time thanks to structural sharing between commits. This means you can have a rich history of changes without worrying about storage bloat.

What's in Version 0.1?

Dumbo v0.1 is Alpha quality software. We don't recommend it for production use, but it's great for testing your existing applications and seeing what they are changing over time. In a test environment, you can use DumboDB just like you would use MongoDB, but with the added ability to reset to specific snapshots in time and see the changes made by your application code.

We are actively developing new features, so please join our Discord server and give us feedback. See the roadmap below!

MongoDB Compatibility

DumboDB implements the MongoDB 8.0 wire protocol and is designed for high parity with core MongoDB operations. It functions as a drop-in replacement for standard drivers and mongosh in single-node environments.

Parity

  • BSON Engine: Full support for BSON type fidelity, including nested documents, arrays, and ObjectIDs.
  • Query & Update: Supports complex MQL operators (e.g., $elemMatch, $all, $rename) and atomic array modifiers ($push, $pull, $bit).
  • Aggregation Framework: Implementation of multi-stage pipelines including $match, $group, $unwind, and $lookup.
  • Indexing: Support for secondary indexes on top-level and nested fields to ensure query performance.

Limitations & Scope

  • No Authentication. DumboDB does not implement any authentication. It is intended for use in trusted environments or local development. Do not expose DumboDB instances to untrusted networks. Planned for v0.6.
  • Single Node: Replication (Replica Sets) and Sharding are out of scope. Support not planned.
  • Ecosystem Features: Proprietary features specific to MongoDB Atlas (e.g., Search Indexes, Serverless Triggers) are not supported. Support not planned.
  • Capped Collections: Fixed-size collections (capped: true) and their oldest-first eviction are not supported; creating one is rejected with an error. Not clear if there is any place for this feature in a version-controlled database. Support not planned.
  • Expiration (TTL): expireAfterSeconds is not supported; specifying it on a collection or index is rejected with an error rather than silently accepted. Support not planned.

If you are needing missing features, please file an issue, or join our Discord server to start a conversation with us. We'd love your feedback!

Version Control Features

DumboDB's version control features are exposed via a set of custom commands (e.g. dumboCommit, dumboMerge, etc.) that you can run from any MongoDB client. These commands allow you to commit changes, create branches, merge branches, view commit history, and more.

Command Description
dumboCommit Commit the current working set with a message and author
dumboBranch Create or delete a branch
dumboBranchStatus Report how many commits each target refspec is ahead and behind a base refspec
dumboMerge Merge a source branch into the current branch
dumboCherryPick Apply one commit's diff onto the current branch
dumboRebase Reapply branch commits onto another branch tip, rewriting history
dumboLog Return commit history for the current branch
dumboStatus Show summary of uncommitted changes on the current branch
dumboDiff Document-level diff between two states
dumboReset Move branch HEAD to a target commit (soft or hard)
dumboRevert Revert a commit, creating a new inverse commit
dumboConflicts List or inspect conflicts from an in-progress merge/cherry-pick/rebase
dumboResolveConflict Resolve a single document conflict (ours / theirs / custom)
dumboTag Create, list, or delete tags at specific commits
dumboGC Run garbage collection on the database's chunk store

All commands have a dolt* alias (e.g. doltCommit, doltMerge). Use whichever prefix you prefer!

Full command reference: Command Reference

Install, Run, Connect

Install DumboDB

Build From Source

git clone https://github.com/dolthub/dumbodb
cd dumbodb
make build                             # Binary ends up here: .runtime/bin/dumbodb
cp .runtime/bin/dumbodb /usr/local/bin # or somewhere else in your $PATH

Released Binaries

We publish pre-built binaries for Linux, MacOS, and Windows on our GitHub Releases page. Download the appropriate binary for your platform, put it somewhere in your PATH. The specifics will depend on your operating system, as they have protections against running arbitrary binaries from the internet, so please refer to your OS documentation for how to run downloaded binaries. We are working on getting signed binaries published to make this easier!

Run DumboDB

The only required argument to run DumboDB is --data-dir, which specifies the directory where your data will be stored. If the directory does not exist, it will be created.

$ dumbodb --data-dir /tmp/dumbodb-data

Connect

Connect with any MongoDB driver, or use the mongosh shell:

mongosh mongodb://localhost:27017

This will connect you to the test database by default. You can specify a different database in the connection string if you like (e.g. mongodb://localhost:27017/mydb)

Example Usage

All examples below are using the mongosh shell, which is effectively JavaScript. There are equivalent operations for any MongoDB driver in your favorite language.

Specifying a Branch

By default, all connections target the main branch. This is currently hard coded. Using the getSiblingDB() method, you can connect to a different branch by encoding the branch name in the database name. @ is the delimiter between the database name and the branch name. For example, to connect to a branch named mybranch, you would connect to the database mydb@mybranch:

var db = db.getSiblingDB("mydb@mybranch")

If you specify a revision rather than a branch name, then the database returned will be read-only and reflect the state of the database at that revision. For example, if you'd like to perform reads against the parent commit of the main branch, you can connect to mydb@main~1:

var db = db.getSiblingDB("mydb@main~1")

Alternatively you can use a commit hash to create a read-only connection to that commit:

var db = db.getSiblingDB("mydb@v9ra3pmi0f6kotj5k3fganpmb3oi9t1k")

Committing Changes

Say you want to stick two documents into the "items" collection, then commit them:

var db = db.getSiblingDB("mydb@main")
db.items.insertOne({ _id: 1, label: "alpha", score: 10 })
db.items.insertOne({ _id: 2, label: "beta",  score: 20 })
db.runCommand({ dumboCommit: 1, message: "baseline", author: "alice <alice@acme.com>" })

The last command creates a new commit with the two inserted documents, and outputs the commit details:

{
  commitId: 'egqis00l0vqg5kd7gbje8k1k6g7dl7ja',
  branch: 'main',
  message: 'baseline',
  author: 'alice <alice@acme.com>',
  timestamp: ISODate('2026-04-28T23:12:23.621Z'),
  committer: 'alice <alice@acme.com>',
  committerTimestamp: ISODate('2026-04-28T23:12:23.621Z'),
  ok: 1
}

Note that there is no need to add items like you would with git add. DumboDB tracks all changes in the working set, and they will all be included in the next commit unless you explicitly discard them.

Seeing Uncommitted Changes

Now let's modify those documents, and add a new one, but don't commit just yet:

db.items.insertOne({ _id: 3, label: "gamma", score: 30 })
db.items.updateOne({ _id: 1 }, { $set: { score: 99 } })
db.items.deleteOne({ _id: 2 })

At this point, if we run dumboStatus, we can see a summary of the uncommitted changes:

db.runCommand({dumboStatus: 1})

Will output the summary of your changes. Specifically, it shows that in the 'items' collection, you have 1 added document, 1 modified document, and 1 deleted document:

{
  branch: 'main',
  dirty: true,
  readonly: false,
  collections: [
    {
      name: 'items',
      status: 'modified',
      added: 1,
      modified: 1,
      deleted: 1
    }
  ],
  ok: 1
}

If you need more detail, you can run dumboDiff. When called with no additional arguments, it will print all of the changes in your session. Specifically everything that is not committed. These are the changes that will be committed when you run dumboCommit.

db.runCommand({ dumboDiff: 1 })

Will produce:

{
  collections: [
    {
      name: 'items',
      status: 'modified',
      added: [ { _id: 3, label: 'gamma', score: 30 } ],
      removed: [ { _id: 2, label: 'beta', score: 20 } ],
      modified: [
        {
          _id: 1,
          diff: [ { type: 'modified', path: '$.score', from: 10, to: 99 } ]
        }
      ]
    }
  ],
  ok: 1
}

Seeing What Changed

You can specify the from and to arguments to dumboDiff to see the changes between any two commits. For example, if you want to see the changes between the current state of your session and the last commit, you can run:

db.runCommand({ dumboDiff: 1, from: "HEAD~1", to: "HEAD" })

The dumboLog command will show you the commit history for the current branch, starting with the most recent commit.

db.runCommand({ dumboLog: 1, limit: 2 })
{
  commits: [
    {
      commitId: 'v9ra3pmi0f6kotj5k3fganpmb3oi9t1k',
      parent1:  'tqq1tn5qs0pns2j2uk5k1b2ufhqt9q3b',
      refs:     [ 'HEAD', 'main' ],
      message:  'alice order updated',
      timestamp: ISODate('2026-04-14T17:22:31.000Z'),
      author:   'alice <alice@acme.com>'
    },
    {
      commitId: 'tqq1tn5qs0pns2j2uk5k1b2ufhqt9q3b',
      parent1:  '5vi6e5t3riqpgh6fq0j1pf0r0imuqhsn',
      message:  'initial data',
      timestamp: ISODate('2026-04-14T09:00:00.000Z'),
      author:   'bob <bob@acme.com>'
    },
  ],
  ok: 1
}

Branching and Merging

You can create a new branch with dumboBranch. In this example, you can see that a new variable feature is created to represent the new branch, and you can run commands against it directly:

// Create the branch
db.runCommand({ dumboBranch: 1, branch: "feature" })
// "checkout"
var feature = db.getSiblingDB("mydb@feature")

feature.items.insertOne({ _id: 4, label: "delta", score: 40 })
feature.runCommand({ dumboCommit: 1, message: "add delta on feature branch", author: "alice <alice@acme.com>" })

The dumboMerge command will merge the changes from the feature branch back into whatever branch you are on. db is still connected to main, so when we run the merge command, it will merge feature into main, which in this case is a fast-forward merge, since main has not diverged from feature. The output of the merge command will show you the new commit that was created on main as a result of the merge.

db.runCommand({ dumboMerge: 1, merge_in: "feature"})
{
  commitId: 'gr2iofosqge0se1dcu2b1a1u42l6udd3',
  message: 'fast-forward',
  ok: 1
}

There are also legitimate merges which join two commit histories, complete with conflict detection and resolution. Look at the Command Reference for more details and examples.

Acknowledgements

DumboDB is built on two open-source projects:

  • FerretDB -- The wire protocol, connection handling, type system, and handler packages were adapted from FerretDB v1.24.2 (Apache 2.0). See ACKNOWLEDGEMENTS for details.
  • Dolt -- The version-controlled storage engine powering every commit, branch, and merge.

Roadmap

DumboDB is in active development, and we have a lot of exciting features planned. Major milestones we are planning:

  • v0.2: Garbage Collection and zstd compression. Reduce the footprint of your database. Simplified configuration for user details (name and email) so yo

Extension points exported contracts — how you extend this code

Interface (Interface)
Interface is an iterator interface. [16 implementers]
internal/util/iterator/iterator.go
Stage (Interface)
Stage is a common interface for all aggregation stages. [116 implementers]
internal/handler/common/aggregations/aggregations.go
Database (Interface)
Database is a generic interface for all backends for accessing databases. Database object should be stateless and tempo [4 …
internal/backends/database.go
CompositeTypeInterface (Interface)
sumtype:decl [2 implementers]
internal/types/types.go
SessionFactory (FuncType)
(no doc)
internal/sqlctx/session_registry.go
Closer (Interface)
Closer is a part of Interface for closing iterators. [25 implementers]
internal/util/iterator/closer.go
Operator (Interface)
Operator is a common interface for standard aggregation operators. [116 implementers]
internal/handler/common/aggregations/operators/operators.go
Collection (Interface)
Collection is a generic interface for all backends for accessing collection. Collection object should be stateless and [4 …
internal/backends/collection.go

Core symbols most depended-on inside this repo

NotFail
called by 928
internal/util/must/must.go
NewCommandErrorMsgWithArgument
called by 701
internal/handler/handlererrors/command.go
NewDocument
called by 651
internal/types/document.go
Collection
called by 643
internal/backends/database.go
Get
called by 620
internal/handler/parameter_store.go
Database
called by 616
internal/backends/backend.go
Error
called by 557
internal/util/lazyerrors/lazyerrors.go
Len
called by 336
internal/types/path.go

Shape

Function 1,924
Method 959
Struct 438
TypeAlias 28
Interface 19
FuncType 12

Languages

Go100%

Modules by API surface

internal/backends/dolt/collection.go88 symbols
internal/backends/versioning.go67 symbols
internal/backends/dolt/backend.go64 symbols
internal/backends/collection.go52 symbols
internal/handler/common/aggregations/stages/set_window_fields.go49 symbols
internal/handler/common/aggregations/operators/arrayops.go48 symbols
internal/backends/backend.go40 symbols
internal/backends/stub/stub.go39 symbols
internal/handler/common/aggregations/operators/mathops.go36 symbols
internal/handler/common/filter_geo.go35 symbols
tests/index_test.go34 symbols
internal/handler/common/aggregations/operators/stringops2.go34 symbols

Datastores touched

itemsCollection · 1 repos
usersCollection · 1 repos
ordersCollection · 1 repos
colCollection · 1 repos
cCollection · 1 repos
testcollCollection · 1 repos
eventsCollection · 1 repos
inventoryCollection · 1 repos

For agents

$ claude mcp add dumbodb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact