Data platform · MongoDB to Couchbase

MongoDB to Couchbase migration: model, move and switch with both databases in sync

Move from MongoDB to Couchbase with one team for both sides: Interkey implements Couchbase, moves data with iblync and keeps both in sync until cutover.

  • Interkey implements and operates Couchbase Design, rollout and operation after go-live
  • Data moved and synced with iblync An Interkey product, delivered and supported by Interkey
  • One team for both sides of the migration The MongoDB source and the Couchbase target in one plan

Moving from MongoDB to Couchbase keeps your data as JSON documents, so the model carries over more directly than a move to a relational database. Queries, indexes and application code still need rework. Interkey implements Couchbase in Saudi Arabia and uses iblync to load the data and keep MongoDB and Couchbase in sync until cutover.

At a glance

The main facts of a MongoDB to Couchbase migration with Interkey
QuestionShort answer
What carries overThe documents themselves: JSON stays JSON, with its nesting and arrays
What needs reworkHow data is organised and keyed, the queries, the indexes and the data-access code in each application
How the data movesAn initial load, then continuous sync with iblync while MongoDB stays in production
Who does the workInterkey: assessment, Couchbase design, data move, cutover and operation, with your application teams
What sets the timelineThe number of collections and applications, the amount of query code, the data volume and the downtime window

What maps directly, and what needs rework

Six areas to check on every MongoDB source. The documents move most directly; the code around them needs the most work.

MongoDB concepts, their Couchbase counterparts and the work each one needs
In MongoDBIn CouchbaseWhat the work is
BSON documents, with types such as ObjectId, Date and Decimal128JSON documentsThe structure carries over. Values with BSON-only types are given a JSON form agreed in advance, for example dates as ISO 8601 strings.
Databases that hold collectionsBuckets that hold scopes, and scopes that hold collectionsEach MongoDB database is assigned a bucket or a scope, and each collection its Couchbase collection.
Queries with find and aggregation pipelinesSQL++ queries, plus direct reads and writes by keyQueries are rewritten in SQL++. Lookups by identifier become key operations through the SDK.
Single-field, compound, multikey, text and TTL indexesGlobal Secondary Indexes, array indexes, Search Service indexes and document expiryEach index is recreated from the list of queries the applications run. Text search moves to the Search Service, and TTL rules become document expiry.
The _id field inside each documentA document key held outside the JSON bodyA key rule is agreed, usually the _id value as a string, and kept in the body too where applications read it.
MongoDB drivers in the applicationCouchbase SDKs for the same languagesThe data-access layer of each application is rewritten against the SDK and tested on production-shaped data.

Each row follows Couchbase's documentation on documents and keys, buckets, scopes and collections, SQL++, indexes and the SDKs. The assessment checks every row against your own collections before any work is planned.

Moving the data with iblync

MongoDB keeps serving production through the first three steps. MongoDB and Couchbase are both on the list of systems iblync connects to, and the parallel run is on parallel run and cutover.

  1. First

    Mapping

    Each collection is assigned its bucket, scope and collection, with the key rule and the form of every BSON-only value agreed in advance.

  2. Next

    Initial load

    iblync copies the existing documents to Couchbase in the agreed shape, at a limited speed so production on MongoDB is not slowed.

  3. Then

    Continuous sync

    iblync applies every change made in MongoDB after the load to Couchbase. If Couchbase is unavailable, changes wait in a queue and are applied when it returns.

  4. The switch

    Cutover

    A final sync and the agreed checks, then application connections move to Couchbase in a short pause whose length is agreed in advance.

Designing the Couchbase side

The target is designed before any data moves, from the way your applications read and write, not only from the shape of the documents.

  • Buckets, scopes and collections. How collections are grouped decides how access, memory and replication are set, so the grouping follows the applications that use them.
  • Document keys. The key rule decides how fast an application can fetch a document directly, without a query.
  • Indexes. Couchbase indexes are built for the queries you run. The list of queries comes first, the indexes follow it.
  • Where Couchbase runs. On Capella, the managed service, or as Couchbase Server in your own data centre in the Kingdom. The choice follows your data residency rules and is made per project; see Capella.

More on the document model is on our document database page. If part of the data may suit tables instead, NoSQL or relational sets out how to decide.

What changes in the applications

Most of the work in this migration sits in the applications, not in the data. Three changes come up in almost every one:

  • The data-access layer moves from the MongoDB driver to the Couchbase SDK for the same language.
  • Queries are rewritten in SQL++, which reads like SQL over JSON. Aggregation pipelines usually become one SQL++ statement with grouping and joins.
  • Lookups by identifier become direct key reads, which need no index and no query.
Read more

Each application is tested on Couchbase with production-shaped data while MongoDB still serves production. Services then move one at a time, and where some already write to Couchbase while others still write to MongoDB, iblync can keep the two in step in both directions. See two-way sync.

How Interkey runs both sides

  1. Assessment.

    Collections, document shapes, query code, indexes, data volume, rate of change, downtime window and where Couchbase will run. The result is a written plan.

  2. Couchbase design.

    Buckets, scopes, collections, key rules and indexes, designed from your applications' queries and set up by Interkey.

  3. Move and sync.

    iblync loads the documents, then keeps Couchbase in step with MongoDB at a speed that does not slow production.

  4. Parallel run.

    Both databases stay live. Applications move service by service, with two-way sync where some already write to Couchbase.

  5. Cutover and operation.

    A final sync and the agreed checks, then connections move. Interkey operates Couchbase after go-live, and iblync support comes from Interkey in Arabic and English.

What shapes the work and the timeline

We do not publish a fixed duration for this migration, because your environment decides it. Four factors shape the work and the timeline:

  • Collections: how many there are, and how varied their documents are.
  • Query code: how many applications use the data, and how many queries and aggregation pipelines each one runs.
  • The data: its volume and how fast it changes.
  • The downtime window the business accepts at cutover.
Read more

The assessment turns these into a schedule for your project, and iblync's weekly and monthly replication reports show the transfer in detail while it runs. The price is discussed in a meeting; see iblync pricing to book one. Before you start, the migration checklist helps you gather the details.

Questions buyers ask

Is Couchbase compatible with MongoDB?

Not directly. Both keep data as JSON documents, so the documents carry over, but the query language and the drivers differ: MongoDB queries are rewritten in SQL++, and applications move to the Couchbase SDKs. Moving between them is a migration project, not a change of connection settings. The assessment lists what changes in each application.

Can MongoDB and Couchbase run in sync during the migration?

Yes, with iblync. Both are among the systems iblync connects to, as a source or a target. After the initial load, iblync applies each change made in MongoDB to Couchbase until cutover, and two-way sync is available while some services already write to Couchbase.

Do we need to redesign our data model?

Not the documents themselves: they stay JSON, with their nesting and arrays. What is reviewed is how collections are grouped into buckets and scopes, the key rule for each document, and the indexes, so that all three suit how Couchbase reads data. The assessment sets how much of this your collections need.

Who supports Couchbase after the migration?

Interkey. We implement Couchbase and operate it after go-live, on Capella or in your own data centre, and the same team that ran the migration stays with the system. The platform itself is Couchbase's. Our Couchbase page describes what Interkey delivers.

How long does the migration take?

It depends on your environment, so we do not publish a fixed duration. The number of collections, the data volume and the number of applications with query code to rewrite decide most of it, then the downtime window you accept. The assessment looks at all of these and gives a schedule for your project.

Next step

Scope a MongoDB to Couchbase migration

Tell us how many collections and applications you run, the data volume, where Couchbase should run, and the downtime window you can accept.

Required field

By sending this form, you agree to our Privacy Notice.

What happens next

  1. We read your request
  2. An engineer contacts you
  3. You get an estimate or a demo
  • Interkey implements and operates Couchbase

    Design, rollout and operation after go-live

  • Data moved and synced with iblync

    An Interkey product, delivered and supported by Interkey

  • One team for both sides of the migration

    The MongoDB source and the Couchbase target in one plan

Or directly

+966-11-2180999 [email protected]

Tawuniya Towers, North Tower, 7th Floor, King Fahad Highway, Olaya, P.O. Box 56835, Riyadh 11564, Saudi Arabia

or Explore Couchbase with Interkey

Published by Interkey. Last updated . Interkey is registered in Riyadh, Saudi Arabia under commercial registration 1010156897.