Working with MongoDB?

MongoDB slow or costing too much? We fix it.

Most MongoDB problems that reach us look like one of three stories: a query that used to be fast now scans a whole collection, an Atlas invoice that quietly doubled, or a collection where every document has slightly different fields. We find which story yours is, and fix the cause.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

mongod.log

still failing

What it is

MongoDB at a glance

MongoDB is an open-source document database, first released in 2009 by 10gen (now MongoDB, Inc., listed on NASDAQ as MDB). It keeps data as BSON documents inside collections, and supports secondary indexes, aggregation pipelines, replica sets, sharding, change streams and Atlas Search backed by Lucene.

MongoDB Atlas is the company's managed service, running clusters on AWS, Azure and Google Cloud. It is a common back end for Node.js and Express apps, the MERN stack, analytics workloads, event stores and content catalogs, where flexible shapes and fast iteration matter more than strict relational joins.

Type
Document database
First released
2009
License
SSPL since 2018 for Community, commercial for Atlas
Maintained by
MongoDB, Inc.
Typically used for
JSON APIs, product catalogs, event stores, IoT time series, rapid prototyping

The honest version

MongoDB pros and cons

No technology is all upside. This is where MongoDB earns its place and where it tends to cause trouble.

Where MongoDB is strong

  • The document model fits JSON dataFlexible schemas let a single document hold what a relational design would spread across several tables, which keeps API code simpler to write and read.
  • Scales out across machinesHorizontal scalability via sharding splits a collection across shards once one server is no longer enough to hold the working set.
  • A capable aggregation pipelineMulti-stage pipelines group, join, reshape and project data inside the database, so reporting queries do not have to drag everything into the application first.
  • Atlas takes the operations workThe hosted Atlas service covers provisioning, patching, backups and metrics across the three major clouds, with change streams for realtime features, Atlas Search for full-text queries and time-series collections for metric-shaped data.

Where MongoDB bites

  • Schemas drift when nobody is watchingWithout a validator, fields get renamed, types silently change and inconsistent documents accumulate silently until a query returns the wrong answer.
  • Missing indexes are brutalA query without a supporting index becomes a full collection scan, which looks fine at ten thousand documents and locks up the cluster at ten million.
  • Atlas pricing adds up fastPer-hour cluster cost plus data transfer plus backups plus Atlas Search plus a larger tier for growth can turn a modest bill into a surprising one within a quarter.
  • Transactions are not freeMulti-document transactions do exist, but they cost more than in a relational database and should be the exception, not how every write is structured.
  • Early shape choices are stickyDenormalisation decisions made on day one are hard to undo once millions of documents already store the data that way.
  • Major upgrades need a windowMoving across major versions needs planning, compatibility checks and a short downtime window, even on Atlas.

Sound familiar?

Common MongoDB problems we fix

The MongoDB problems that bring people to us, and what you have once each one is fixed.

1,200,000 documents examined, 42 returned

A query that used to be fast now crawls

A filter running without a supporting index, or an aggregation pipeline that cannot use the indexes you do have.

Indexed, with explain plans attached

Atlas monthly cost: $4,210 (prev month $820)

The Atlas bill tripled this month

An oversized cluster tier, Atlas Search left on a collection that no longer needs it, or backups and data transfer piling up unseen.

Right-sized, with a monthly review

fields present in only 38% of documents

Schema drift is making queries unreliable

Fields spelled two ways, types mixed between string and number, optional data that the application now assumes is always there.

Validators and a cleanup pass

E11000 duplicate key error collection: users index: email_1

Duplicate key errors are reaching production

A unique index added after data already contained duplicates, or writes racing without proper upsert handling.

Index rebuilt on cleaned data

oplog window shrunk to 11 minutes

Replication is dangerously close to falling behind

Write volume outrunning the oplog, or a secondary unable to catch up after a maintenance event.

Oplog resized, writes smoothed

last verified restore: never

Backups exist but nobody has restored one

Atlas snapshots sitting there untouched, or a mongodump cron that may or may not actually produce usable output.

Restores rehearsed on a schedule

What we do

MongoDB help, from rescue to upkeep

Call us for one slow query, or hand us the whole cluster.

Rescue
Cluster down, authentication broken or primary election looping. We get reads and writes flowing again, then find the cause.
Performance
Index design, aggregation rewrites, read and write concern choices, with before and after numbers against real traffic.
Atlas cost review
Tier, storage, Search and backup settings examined line by line, with a plan to bring the monthly bill back down.
Schema work
Validators added, inconsistent documents cleaned up, and the data model adjusted so new features stop fighting the old shape.
Migrations
Moving clusters between regions or clouds, onto Atlas, or taking over from a previous team without losing data.
Managed Tech
Someone watching cluster health, oplog window, index use and Atlas spend each week, with action taken before the dashboard turns red.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running MongoDB alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

MongoDB questions

Something else? Call+1 737 727 7327

Why is our MongoDB query so slow?

Almost always a missing or wrong index, which turns the query into a full collection scan. The explain plan tells us straight away whether documents are being examined in the millions to return a handful, and from there the fix is a targeted index or a rewritten pipeline, not a bigger cluster.

Why did our MongoDB Atlas bill triple this month?

Usually a cluster tier bumped up for a one-off load and never dropped back, Atlas Search left running on collections that do not need it, backup retention that quietly grew, or egress from a new analytics job. We go through the invoice line by line and show you which items are worth paying and which are not.

Can you take over a MongoDB cluster from a previous team?

Yes, and this is a common call. We document what is there, rotate credentials, confirm backups actually restore, and work through the undocumented corners before anyone needs to touch them in an emergency.

Should we move from MongoDB to PostgreSQL?

Only when the data is really relational and the pain of joins in application code outweighs the flexibility you are getting from documents. For many apps the right answer is to keep MongoDB and fix the indexes and schema instead. We will tell you plainly which case yours is.

Why are we getting E11000 duplicate key errors?

A unique index is rejecting a write that collides with an existing document. Either the data already contained duplicates when the index was added, or the application is inserting instead of upserting. We clean the duplicates, then adjust the write path so it stops happening.

How much does MongoDB help cost?

Estimates are free. Describe the cluster and the symptoms and you get a price before any work begins.

Free estimate

Need help with MongoDB?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.