explaingit

qihoo360/mongosync

Analysis updated 2026-08-14 · repo last pushed 2017-12-01

155C++Audience · ops devopsComplexity · 4/5DormantSetup · hard

TLDR

A tool for copying data between two MongoDB databases, supporting one-time copies, continuous real-time syncing, and oplog archiving. Built in C++ for high-performance data migration and backup.

Mindmap

mindmap
  root((mongosync))
    What it does
      Full data clone
      Continuous real-time sync
      Oplog archive copy
    Tech stack
      C++
      MongoDB
    Use cases
      Database migration
      Live backup
      Analytics mirror
    Audience
      Database admins
      Infrastructure teams
    Setup
      Compile from source
      No C++11 support
      Configurable filters

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Migrate a MongoDB database to new hardware with minimal downtime using continuous sync.

USE CASE 2

Create a live backup database that stays up to date with changes from production.

USE CASE 3

Set up a separate MongoDB instance for analytics that mirrors your production data.

USE CASE 4

Archive a record of all database activity by copying the oplog without applying changes.

What is it built with?

C++MongoDB

How does it compare?

qihoo360/mongosyncdk8827/ra-portfaldyrd/auto-2026
Stars155157157
LanguageC++C++C++
Last pushed2017-12-01
MaintenanceDormant
Setup difficultyhardhardeasy
Complexity4/54/51/5
Audienceops devopsdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Must be compiled from C++ source and explicitly must not use C++11 support due to compilation errors.

The license terms are not specified in the repository documentation, so you should verify permissions before using this tool.

In plain English

mongosync is a tool for copying data between two MongoDB databases. It was built by the database and infrastructure team at Qihoo 360 to move data from one MongoDB server to another, whether you are doing a full copy, keeping a destination database continuously updated with changes, or just archiving a record of what changed. The tool supports three main modes. The first is a straightforward data clone, which copies your existing records from a source database to a destination. The second goes further by also replaying the source database's "oplog" onto the destination, meaning any new writes, updates, or deletes happening on the source are applied to the destination in real time. The third mode simply copies the oplog itself without applying the changes, which is useful if you want to keep an archive of database activity without modifying your destination data. This would be useful for a team migrating a database to new hardware, creating a live backup that stays in sync, or setting up a separate database for analytics that mirrors production data. You can configure exactly what gets copied by specifying particular databases or collections, and you can even filter records so only certain data is transferred. It supports authentication on both sides, so you can securely connect to protected servers. In terms of performance, the team tested it by moving about 36 million records (roughly 1 GB of data) in just over six minutes, achieving around 96,000 operations per second. They note that the main bottleneck is how fast the destination database can write, so using multiple connections can speed things up if your target server can handle the load. The project is written in C++ and must be compiled before use, though the README notes it should not be compiled with C++11 support due to errors that arise.

Copy-paste prompts

Prompt 1
I need to migrate a MongoDB database to a new server with minimal downtime. Help me use mongosync to first clone the data and then enable continuous sync to replay the oplog until I am ready to switch over.
Prompt 2
I want to create a live backup of my MongoDB database using mongosync. Walk me through setting up continuous sync so the backup stays updated with all writes, updates, and deletes from the source.
Prompt 3
Help me configure mongosync to only copy specific databases and collections from my MongoDB source, and filter records so only documents matching certain criteria are transferred.
Prompt 4
I want to use mongosync to archive my MongoDB oplog without applying changes to the destination. Explain how to set up oplog-only mode and what the resulting archive looks like.

Frequently asked questions

What is mongosync?

A tool for copying data between two MongoDB databases, supporting one-time copies, continuous real-time syncing, and oplog archiving. Built in C++ for high-performance data migration and backup.

What language is mongosync written in?

Mainly C++. The stack also includes C++, MongoDB.

Is mongosync actively maintained?

Dormant — no commits in 2+ years (last push 2017-12-01).

What license does mongosync use?

The license terms are not specified in the repository documentation, so you should verify permissions before using this tool.

How hard is mongosync to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is mongosync for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.