r/mongodb • • 3h ago

I measured a 1,000-database test-data setup with MongoDB and KryptonDB

2 Upvotes

Disclosure: we built KryptonDB. It’s a local, in-memory database that speaks the MongoDB wire protocol for a documented subset

we built it for tests and coding agents that need separate databases seeded with the same data. Its forkDatabase command is a KryptonDB extension, not a MongoDB command.

we attached a short video of a memory comparison. I ran both servers on the same Linux host, with a fresh server process for each run. MongoDB got a new, empty data directory each time; I recorded its baseline before adding user data.

for the workload, each server received the same 10,000 documents, then held 1,000 databases containing that seed. I read one document from each database and inserted 10 new documents into each of 100 databases.

MongoDB used $out to make full collection copies. KryptonDB made copy-on-write branches from the seed.

Median process-tree PSS across three runs:

  • Empty server: MongoDB 161.27 MiB vs KryptonDB 9.89 MiB
  • 1,000 databases: MongoDB 1.62 GiB vs KryptonDB 22.49 MiB
  • After one read per database: MongoDB 1.63 GiB vs KryptonDB 23.20 MiB
  • After the inserts: MongoDB 1.63 GiB vs KryptonDB 24.02 MiB
  • Idle CPU after database creation: 2.40% vs 0.10% of one core, measured over 10 seconds with no client connected

the copy methods differ, and the memory numbers are process-tree PSS for this host and workload, PSS does not measure all host page cache or MongoDB’s full on-disk data.

other MongoDB copy or storage setups may produce different results.

KryptonDB is for disposable local development and test data. It supports a subset of MongoDB behavior, does not clone a live MongoDB deployment, and is not a MongoDB or Atlas replacement.

its default in-memory data is cleared when the server stops, it has no authentication or TLS, so I keep it bound to loopback.

for those running MongoDB-backed tests, how do you give each worker its own seeded data today?

what would you want validated before trying a local branch workflow?

Project: https://github.com/nhrbuilds/kryptondb


r/mongodb • • 1h ago

MongoDB v4 fails to run without AVX support

Thumbnail reddit.com
1 Upvotes

mongo:3 runs fine as expected, but no luck with any mongo:4 or any variant of 4.


r/mongodb • • 3h ago

MongoDB drops nearly 18% despite a raised outlook as analysts flag slower sign-ups

Thumbnail quantisnow.com
1 Upvotes

r/mongodb • • 11h ago

We built a free, open-source MongoDB GUI and would love feedback from people who use MongoDB daily

Post image
2 Upvotes

r/mongodb • • 1d ago

Advent of MongoDB 2026 – 24 free MongoDB challenges leading up to Christmas

Post image
3 Upvotes

Happy Holidays MongoDB!

Most "Advent of SQL" style events leave MongoDB out, so I made one for it: 24 puzzles from December 1 to 24, written in mongosh, around one mystery. 

Someone tampered with Santa's Nice List and you find out who from the North Pole's collections.

The data is shaped the way you'd actually model it in MongoDB, not SQL tables copied over. Elves have an embedded leave array, wishes live inside each child's document, and the Nice List is a log collection. So the puzzles exercise:

  • find with projection and sort for the warm-up days
  • $group, $cond inside $sum, $unwind
  • $lookup and $graphLookup (walking a chain of managers)
  • $lookup with a let + pipeline (the latest door swipe before a given time)
  • $setIsSubset, $addToSet and $setWindowFields for running totals
  • $reduce and $substrCP for the final day's hidden message

It runs entirely in the browser, and your pipeline is checked against the visible data and hidden datasets, so it has to be correct rather than lucky.

https://visualeaf.com/advent-of-mongodb/

Completely free. No account, no installation, no Atlas cluster needed.

Have fun, and happy holidays!


r/mongodb • • 1d ago

Is there a good mongo-express alternative going into 2027? Something like phpMyAdmin, but for MongoDB

6 Upvotes

What are you guys using to manage your MongoDB instances directly from the browser?

I'm thinking of something similar to phpMyAdmin or Adminer, where you can browse collections, edit documents and run queries.

Ideally something open source that I can self host without having to expose my infrastructure to the internet

I know mongo-express exists, but the UI is pretty ugly and feels outdated


r/mongodb • • 1d ago

mongo-php-async-driver: an async, drop-in replacement for the MongoDB PHP extension, up to 4x faster

Thumbnail blog.daniil.it
1 Upvotes

mongo-php-async-driver is a rewrite from the ground up (it doesn’t even used the official Rust extension or even the PHP Revolt event loop, providing pure Rust rewrites of both for maximum performance), which allows 2x faster performance than the C extension even without async, and even more than that when concurrency is used.

It is currently being staged for deployment at a big client, it’s already getting quite some action in CI and devboxes, with excellent results so far! 


r/mongodb • • 1d ago

What do you use MongoDB for in real-world projects?

1 Upvotes

Hey everyone! I'm currently exploring MongoDB and would like to learn more about its practical use cases

What kind of data do you typically store in MongoDB? If you use multiple databases in your projects, such as MongoDB and ClickHouse, how do you decide which data goes where?

I'm also curious about MongoDB's security and reliability in production. Are there any limitations or common pitfalls I should know about?

I'd love to hear about your real-world experience.


r/mongodb • • 2d ago

Interview tip

3 Upvotes

Hi,

I will be interviewing for a MongoDB SE3 query optimization role. As I could not find much about the interview experience, can anyone please help regarding how the interview process is there? What all do I need to prepare? How many rounds are there and what are the expectations?

Any lead will help me a lot.


r/mongodb • • 3d ago

MongoDB Atlas M0 cluster: TLS handshake fails on primary and one secondary, but another secondary connects

2 Upvotes

Hi everyone,

I'm facing a connectivity issue with my MongoDB Atlas M0 Free Tier cluster.

Cluster details:

  • Cluster: NoteNestCluster
  • Provider/Region: AWS Mumbai (ap-south-1)
  • Connection method: Node.js with Mongoose
  • Node.js version: 26.13.1
  • MongoDB Node.js driver: 7.9.1
  • Mongoose: 9.13.0

Problem:

My cluster has three replica set members:

  • shard-00-00: Secondary
  • shard-00-01: Primary
  • shard-00-02: Secondary

From my Windows machine, TLS connections to shard-00-00 and shard-00-01 fail with:

ERR_SSL_TLSV1_ALERT_INTERNAL_ERROR (SSL alert 80).

However, TLS to shard-00-02 succeeds using TLS 1.3.

I can connect directly to shard-00-02, and MongoDB authentication succeeds. But when my application tries to register a user or perform another write, MongoDB returns:

MongoServerError: not primary
codeName: NotWritablePrimary
code: 10107

The hello command confirms that shard-00-01 is the writable primary.

All three nodes are reachable on port 27017. Atlas shows the cluster as Available and all three members as healthy.

What I've tried:

  • Resetting the database user's password
  • Testing TLS connectivity to each replica set member
  • Testing direct MongoDB connections
  • Using the standard Atlas SRV connection string
  • Checking the replica set's primary through the hello command

The standard SRV connection is still failing because TLS connections to two members fail.

Questions:

  1. Why would TLS fail on the primary and one secondary while the other secondary works?
  2. Could this be an Atlas-side networking or certificate issue?
  3. What should I do to restore normal replica set connectivity?

I'd appreciate any suggestions. Thank you!


r/mongodb • • 4d ago

I cant access mongodb online course, what should i do??

Post image
2 Upvotes

r/mongodb • • 7d ago

A new way to practice MongoDB online for free: LeetCode-style problems with hidden test cases

Post image
9 Upvotes

Hi everyone! I've spent months building a free website for practicing MongoDB, and I wanted to share it with the community.

One thing I noticed when learning MongoDB was that there weren't many places where you could actually practice writing queries and have your solutions tested, similar to how LeetCode works. So I decided to build one. As far as I know, it's the first of its kind.

Most MongoDB practice sites just parse your query or compare it to a fixed answer. This one runs a real MongoDB-compatible database right in your browser, so you can do what you'd do in a real shell: create collections, insert and update documents, build indexes, run aggregation pipelines and check explain plans. Your code is executed and validated against hidden test cases.

What you can do:

  • Practice MongoDB directly in your browser, with no install and no sign-up.
  • Write real find, aggregate, and createIndex code with mongosh syntax. (even $search)
  • Work through 30 MongoDB interview questions, from Medium to Expert: joins, grouping, arrays, schema drift, geo queries and window functions.
  • Test your solutions against multiple hidden datasets, so queries that only work on the sample data get caught.
  • Practice query optimization, with performance questions graded on your explain plan.

All the problems and their solutions have been verified against MongoDB 8.

Getting all of this to run entirely in your browser, with no server behind it, took months of work, and your queries never leave your machine.

It's completely free, and I'd love to hear what you think, especially if there are MongoDB concepts or challenges you'd like me to add.

https://visualeaf.com/mongodb-interview-questions/


r/mongodb • • 7d ago

Mongodb Data Compression

3 Upvotes

Hey guys we are using mongodb as our main db with 3 nodes replica .Each node of almost 20 TB disc with default snappy compressor ,recently we went with encryption of PI DATA on each node .Before encryption disc sizes was almost 13 TB on each node .After encryption it back to 20 TB .So to reduce cost we are planning of using ZTSD compression on each node it can reduce upto 20 -30 percent on each node ,but the problem is the data is already encrypted ,so can we compress the encrypted data on the disc ,as it can reduce the size or any other alternatives…?
Mostly in every collection we have PI data ,as the company’s business is lending business….


r/mongodb • • 10d ago

I built a self-hosted, browser-based MongoDB manager for teams (open source, AGPL-3.0)

14 Upvotes

Hi r/mongodb! Compass is a great tool, but it's built for one person on one laptop. I wanted something my whole team could use from a browser, running on our own server, with roles, an audit log and backups built in. So I built Mongo Manager.

GitHub: https://github.com/mongo-manager/mongo-manager

What it does for MongoDB specifically:

  • Query plans: explain output as a tree with warnings, and a suggested index prefilled ("why is it slow?"). On sharded clusters it shows each shard's plan.
  • Aggregation builder: stage cards with a live preview of each stage on a sample; $out/$merge only run after a confirmation. Pipelines export to Node.js, Python, Java, Go, C#, PHP, Ruby and Rust.
  • Indexes: every type and option, $indexStats usage, plus Atlas Search and Vector Search indexes.
  • Schema analysis: field types, frequency and value histograms; generate validation rules from a sample and test them against existing documents.
  • Replica sets: member status and replication lag with 7 days of history, lag alerts, and change streams with filters and pre-images.
  • Sharding: chunk distribution per shard, zones, balancer windows, and a shard key check before you shard a collection.
  • Live sync: a continuous, verified copy between connections, ending with a cutover.
  • Backups: mongodump archives or encrypted files, scheduled, to S3, Google Drive, WebDAV or a local folder; restores get a dry run first.
  • Auth: SCRAM, X.509, LDAP, AWS IAM, OIDC, Kerberos, SSH tunnels; CSFLE and Queryable Encryption.

For teams: admin/editor/viewer roles, access per connection, 2FA, a hash-chained audit log, and rule-based masking of personal data.

Try it: npx @mongo-manager/app (Node 24+), Docker, or a standalone binary. Supports MongoDB 6.0+, Atlas included. Works fully offline.

About AI: there's an optional AI agent (your own provider, or Ollama locally) that never changes anything without your confirmation. Also, to be upfront: most of the code was written with Claude. I designed it, reviewed it, and the server tests run against real MongoDB 6.0, 7.0, 8.0 and 8.3 servers and replica sets.

It's a new project, so I'd really appreciate feedback, especially from people running replica sets or sharded clusters in production. What would you need before trusting a tool like this with your databases?


r/mongodb • • 11d ago

My partial index was ignored because the query said $exists/$ne and the index said $gt "". Fixing that took it from 12s to 11ms.

5 Upvotes

Sharing because this cost me a deploy and the reason is easy to miss.

Setup: a collection with about 500k documents, 20 GB, growing 10 GB a month. One endpoint polls it all day: newest unclaimed request for a tenant. The query looked like this:

{ tenant, namespace, status: "New", "spec.curl": { $exists: true, $ne: "" } }

It had slowed to about 12 seconds.

Most documents in the collection are finished, so a normal index would mostly hold entries that never match. A partial index only indexes documents that match a condition, so I built one:

db.requests.createIndex(

{ tenant: 1, namespace: 1, status: 1 },

{ partialFilterExpression: { "spec.curl": { $gt: "" }, status: "New" } }

)

That covers a few thousand documents instead of 500k. Deployed it. Query still took 12 seconds.

`explain()` showed a COLLSCAN, so the index was not being used. The reason: MongoDB only uses a partial index when it can tell the query is a subset of the index condition. My query said `$exists: true, $ne: ""`. The index said `$gt: ""`. For string fields those match the same documents, but the planner does not reason that far. It wants the query to use a predicate it can match directly.

I changed the query to `"spec.curl": { $gt: "" }`. The index got used. 11 ms.

Second gotcha from the same week. Our app creates its indexes on startup and exits if an index with the same name exists with different options. One environment had an older version of this index (same name, partial filter was only `status: "New"`). The app crash-looped on deploy until that index was dropped. New rule for us: build the index in Atlas first with a rolling build, same name and options, wait for it to finish, then ship the code.

What I'd pass on:

- Write the query the same way as the partial filter. Same meaning is not enough.

- Run `explain("executionStats")` on the real query before you say the index is done.

- Partial indexes fit any "small active subset inside a big collection" pattern. Most queue-style collections are like that.

Does anyone have a check that catches "query does not match the partial filter" before deploy? Right now I catch it by reading the code.


r/mongodb • • 11d ago

I built Rusa, an open-source MongoDB client in Flutter for Desktop & Mobile (GPLv3)

3 Upvotes

Hey everyone! After months of building, I just launched Rusa v1.0, a modern, native-feeling MongoDB client built with Flutter.Why I built it:
I wanted a lightweight alternative to heavy Electron-based MongoDB GUIs that also lets me inspect collections and run quick queries from my phone when I'm away from my desk.

What’s live in v1.0:
Supported Platforms: Windows, Linux, and Android are ready to download today (macOS and iOS are coming soon).

Open-Source (GPLv3): You can inspect the full source code and verify how credentials are stored locally.

Core Features: Fast document browsing, JSON/BSON editing, and query filtering across desktop and mobile.

Links:
Website & Downloads: https://rusa.deveditortools.com
Product Hunt Launch (would love your feedback there too!): https://www.producthunt.com/products/rusa

Let me know what OS you're testing on and what features (SSH tunneling, aggregation pipeline builder, schema analysis) would make this useful in your daily workflow!


r/mongodb • • 13d ago

mongoexport is great for one collection. What do you use for multi-collection or non-MongoDB exports?

3 Upvotes

I work on Dsync, a database migration tool, so weigh this accordingly.

mongoexport is a great tool for pulling one collection out to JSON or CSV. Two things I've wanted from it: the same kind of export from DynamoDB or Cosmos DB, and big exports that finish faster. What the MongoDB Database Tools docs say about its limits (mongoexport, mongodump):

  • mongoexport exports one collection per run (--collection is required) and has no parallel option. The only way the docs show to split an export is --sort with --skip and --limit, one command per piece. The usual workaround is parallel mongoexport processes, each with a --query on an _id range. The request for a multi-threaded mongoexport (TOOLS-248) was closed as Won't Fix.
  • JSON export is relaxed Extended JSON by default. Use --jsonFormat=canonical if you need every BSON type back.

If the data is only in MongoDB, a shell loop running mongoexport once per collection covers several collections.

For the other cases we added an open-source File connector to Dsync. It writes Dsync sources such as MongoDB and DynamoDB to CSV, one file per collection or table, and can load the files into another Dsync destination:

dsync --mode InitialSync --namespace "shop.orders,shop.customers" \
  mongodb://localhost:27017 file:///data/export

On speed: once a collection has about 100,000 documents (twice the --doc-partition default of 50,000), Dsync splits it into _id ranges and reads them in parallel. The connector still writes its files one batch at a time, and we haven't formally benchmarked it against mongoexport.

We reworked how it handles values in v0.31.0. A key that first appears in a later document becomes a new column. ObjectIDs are written as hex, dates as ISO 8601, nested documents and arrays as Extended JSON, and on reload _id and most types come back.

Disclaimer on current limits: CSV only, no field selection. A null, a missing field and an empty string all reload as missing. A top-level string of digits, such as an order number, comes back as a number unless you pass --infer-types=false (digit strings with a leading zero stay strings), and a string holding a JSON object or array comes back as an embedded document or array. The MongoDB source refuses a collection whose smallest and largest _id have different BSON types. An export overwrites an existing file for the same collection, and there's no CDC. For backups I'd still use mongodump.

Source (Go, AGPL, PRs welcome): https://github.com/adiom-data/dsync/tree/main/connectors/file


r/mongodb • • 13d ago

When would MongoDB make a sports booking app easier to build than MySQL?

1 Upvotes

Imagine a sports booking app where every facility has a name and location, but the details vary. A swimming pool lists lane count and water depth. A badminton court lists flooring and whether it’s indoors. Facilities keep adding new amenities and sports.

If you were building this, what would be easier to add or change with MongoDB than with a MySQL design built around fixed columns?

I’m trying to explain the practical difference in one sentence without using “NoSQL” or “schema flexibility”. How would you put it? If you’d choose MySQL anyway, I’d be curious what would tip the choice for you.


r/mongodb • • 14d ago

After months of job rejections, I spent 2 years building a MongoDB GUI. It just got added to Microsoft's Azure docs.

14 Upvotes

After struggling to land a job in 2024, when the market was pretty rough, I decided to take a different route and build something real. My goal was simple: either build something genuinely useful or gain more experience than anything else could offer.

Two years and countless 90-hour weeks later, VisuaLeaf is now featured in Microsoft's Azure DocumentDB documentation as a client for connecting to its MongoDB-compatible database service:

https://learn.microsoft.com/en-us/azure/documentdb/how-to-connect-visualeaf

It started as a MongoDB GUI, so posting this announcement really means a lot to me since this was the subreddit that started it all.

From the beginning, I wanted every part of the database workflow to feel as straightforward as possible, from exploring nested documents and building queries to database management and integrating AI. VisuaLeaf has evolved quite a bit since I first shared it here.

Today, VisuaLeaf supports MongoDB, Postgres, MySQL, SQLite, DuckDB, and 40+ more database engines.

What it does:

  • Table + tree views built for nested documents: Expand nested objects and arrays directly into columns within the table instead of having to deal with json in 1 cell, or having a separate embedded view dedicated for an array. Both views stay smooth even with massive collections.
  • Visual query builder + MongoDB shell: Build queries by clicking or dragging fields directly from the table and tree views, or write commands in the built-in MongoDB shell with real-time syntax error highlighting and intelligent autocomplete. Generated queries are readable and can be copied or executed.
  • Data transfers with transformations: Move data between databases (Postgres → MongoDB, SQLite → MongoDB, MongoDB → MongoDB), mask sensitive fields, apply custom JavaScript transformations, and enrich data with lookups from other collections.
  • Compare and sync: Compare collection structures and data, preview differences, and synchronize databases between environments, with dry-run support.
  • AI / MCP:  The MCP server is read-only by default. You can grant write access per connection, so an agent can run aggregations, data transfers, or anything else the app can do. There's also a built-in assistant for quick tasks, similar to Compass's.
  • Sharding and clusters: manage shards on any sharded cluster (shard-key advisor, chunks, zones, balancer, resharding), or deploy and run your own self-hosted replica set or sharded cluster on Docker or Kubernetes.
  • ERDs, charts, dashboards, mock data, index management, query profilers, and a lot more than I can fit into one post
  • Performance:  I've stress-tested datasets up to 1.6 GB, and the tree can expand thousands of rows at once. Existing grid libraries like AG-Grid couldn't support the nested column expansion I wanted, so I built my own grid from scratch, which took roughly a year to develop and optimize. (In my testing, VisuaLeaf also loaded data several seconds faster than nearly all MongoDB GUIs I’ve tested it against).

There's a free version that covers what most people need day to day:

https://visualeaf.com

I'd really appreciate feedback! And happy to answer any questions!

PS. VisuaLeaf is the only app that actually supports MongoDB Version 3.4 and newer versions of MongoDB in one app (from what I’ve seen). 


r/mongodb • • 14d ago

MongoDB Acquires Firebolt to Bring Lightning-Fast Real-Time Analytics Into Its Intelligent Data Platform

Thumbnail mongodb.com
29 Upvotes

what do you guys think? Analytics play beneficial here? Are they trying to infringe on Snowflake/Databrick's turf (since I know Databricks has bought Neon, a postgres company). AI narrative?


r/mongodb • • 14d ago

i m new to mongo db and have to upload this assignment now This assignment needs to be done in MongoDB using mongosh (MongoDB Shell) or MongoDB Compass

0 Upvotes

i want screenshots to upload Please 1. Q1

5 marks

Create the four collections (mentioned in Problem Statement) in MongoDB.\

For posts and comments, justify in one line each whether userId should be embedded (storing user details directly inside the document) or referenced (storing only the _id and looking it up separately), and implement the chosen design consistently across all four collections.\

Insert one sample document into each collection and display it with find() to confirm the structure before proceeding.

Drag & drop or click to browsePDF, ZIP, DOCX, PNG, JPG, DOC, TXT up to 25MB · max 1 fileQ2. Data Population

5 marks

Q2 Insert at least 6 users, 10 posts (across different users), 15 comments (across different posts) and 20 likes (across different posts/users), ensuring enough variety to support later aggregation (e.g., at least one user with multiple posts, at least one post with no comments).

Then perform: (a) find() with a filter (e.g., posts by one specific user), (b) updateOne() to edit a post's content, (c) deleteOne() to remove one comment, showing the collection state after each operation.

Drag & drop or click to browsePDF, DOCX, DOC, JPG, PNG, ZIP, TXT up to 25MB · max 1 file

Q3. Aggregation pipelines

5 marks

Write three aggregation pipelines using $match, $group and $sort: (a) total likes per post, sorted descending, (b) total posts per user, (c) average number of comments per post across the whole posts collection.

Use $lookup in at least one pipeline to join posts with users and display the user's name alongside their post's like count.

Drag & drop or click to browsePDF, ZIP, TXT, DOCX, PNG, DOC, JPG up to 25MB · max 1 file

4. Q4. Index

5 marks

Create a single-field index on posts.userId and a compound index on comments covering postId and createdAt.

Re-run one query from Q3 before and after creating the relevant index, and compare the output of explain("executionStats") (documents examined, execution time) for both runs.

Drag & drop or click to browsePDF, ZIP, TXT, DOCX, PNG, DOC, JPG up to 25MB · max 1 file

You can submit once. Make sure all files are added.

Submit

Give each image for each question seperate


r/mongodb • • 15d ago

Data migration

6 Upvotes

Hi,

We're using the Community Edition and want to migrate 20TB of data to a new cloud environment. Do you have any recommendations on the best approach, or any other advice you could share?


r/mongodb • • 18d ago

Does anyone actually use SQL with mongo?

4 Upvotes

I make a database app (https://beekeeperstudio.io), and we built our own SQL to mongo transpiler but frankly it's not as popular as I thought it would be.

I know mongo themselves have a SQL layer. Does anyone actually use it? If so, why use it over regular mongo queries?


r/mongodb • • 20d ago

i need help installing mongodb on my mac

Post image
3 Upvotes

i need to download it for an assignment but everytime i try to install it this happens can any one help