Ilja
Ilja

Reputation: 46479

How does indexing work on mongodb serverless?

When running a dedicated instance of mongod, indexing large collections can result in blocked writes / increased response times, thus we usually do rolling indexes on secondary instances first and promote them to primary once done.

I'm unable to find any documentation on this for mongodb serverles. How does it handle these long running jobs and what are the costs?

Is this assumption correct?

  1. Mongodb serverless performs indexing in the background and spins up new instances once indexing is down, while taking old ones offline?
  2. Each index is charged as a write?

Upvotes: 0

Views: 129

Answers (1)

Alex Blex
Alex Blex

Reputation: 37048

Rolling indexing is intended

For workloads which cannot tolerate performance decrease due to index builds

I don't believe serverless Atlas aims this particular audience. Instead it's focuses on easy-to-start and no-long-term-commitments selling points, i.e. for infrequent/random usage pattern which can be more cost -efficient comparing to standard cluster offering.

From the long list of limitations, it explicitly says:

Build Index with Rolling Build | Serverless instances don't support building indexes with a rolling build.

So no, it's unlikely the assumption is correct. I believe they use standard routine introduced in v4.2 when they ditched foreground indexes: https://www.mongodb.com/docs/v4.2/core/index-creation/#index-operations


Disclaimer:

The question is about implementation details of a proprietary service. I do not work in MongoDB Inc, nor don't have access to internal architecture documentation. The answer is based on publicly available resources and common sense.

Upvotes: 3

Related Questions