|
| 1 | +--- |
| 2 | +title: MongoDB Atlas + ObjectBox Sync: Quickstart + production notes |
| 3 | +description: Companion guide from ObjectBox: quick navigation, production caveats, and key docs for syncing ObjectBox clients with MongoDB Atlas. |
| 4 | +slug: /dev-how-tos/mongodb-atlas-objectbox-sync-quickstart-production-notes |
| 5 | +--- |
| 6 | + |
| 7 | +import Link from '@docusaurus/Link'; |
| 8 | + |
| 9 | +# MongoDB Atlas + ObjectBox Sync: Quickstart + production notes |
| 10 | + |
| 11 | +**TL;DR:** Use **ObjectBox on the device** for offline-first performance, run **ObjectBox Sync Server** as the sync engine, and connect it to **MongoDB Atlas** via the **MongoDB Sync Connector**. |
| 12 | + |
| 13 | +## What this page is (and isn’t) |
| 14 | + |
| 15 | +- This is a **companion guide** from ObjectBox: quick navigation, production caveats, and troubleshooting pointers. |
| 16 | +- The full end-to-end walkthrough is **MongoDB-authored** (by Fidaa B.): |
| 17 | + |
| 18 | +https://dev.to/mongodb/mongodb-data-sync-for-offline-first-apps-keep-data-in-sync-with-objectbox-and-mongodb-atlas-34k8 |
| 19 | + |
| 20 | +## Architecture at a glance |
| 21 | + |
| 22 | +**MongoDB Atlas ⇄ ObjectBox Sync Server ⇄ ObjectBox (mobile/edge clients)** |
| 23 | + |
| 24 | +- Clients keep working offline using the local ObjectBox database. |
| 25 | +- The Sync Server coordinates changes and syncs bidirectionally with MongoDB via the connector. |
| 26 | + |
| 27 | +## Quickstart (fast route) |
| 28 | + |
| 29 | +### 1) Start with the MongoDB tutorial |
| 30 | + |
| 31 | +Follow the end-to-end demo against a MongoDB Atlas cluster: |
| 32 | + |
| 33 | +https://dev.to/mongodb/mongodb-data-sync-for-offline-first-apps-keep-data-in-sync-with-objectbox-and-mongodb-atlas-34k8 |
| 34 | + |
| 35 | +### 2) Keep these ObjectBox references open |
| 36 | + |
| 37 | +- MongoDB Sync Connector overview: https://sync.objectbox.io/mongodb-sync-connector |
| 38 | +- Connector setup: https://sync.objectbox.io/mongodb-sync-connector/objectbox-sync-connector-setup |
| 39 | +- Sync Server configuration: https://sync.objectbox.io/sync-server/configuration |
| 40 | +- ObjectBox Sync docs (start here): https://sync.objectbox.io/ |
| 41 | + |
| 42 | +## Production notes (the stuff that bites later) |
| 43 | + |
| 44 | +### MongoDB connection & “primary DB” discipline |
| 45 | + |
| 46 | +- The connector needs a MongoDB connection string and a **primary MongoDB database name**. |
| 47 | +- After a full sync in a given environment, avoid switching the primary database unless you plan a reset/re-sync (especially during development). |
| 48 | + |
| 49 | +### Prefer config files for non-trivial setups |
| 50 | + |
| 51 | +For anything beyond basic settings, use a configuration file approach (repeatable, reviewable, and easier to automate). |
| 52 | + |
| 53 | +### Offline reality: plan for long gaps |
| 54 | + |
| 55 | +Assume devices can be offline for days/weeks. Document your approach to: |
| 56 | + |
| 57 | +- conflict strategy |
| 58 | +- schema evolution/migrations |
| 59 | +- monitoring / backlog visibility |
| 60 | + |
| 61 | +### Security & access |
| 62 | + |
| 63 | +Treat Sync Server as production infrastructure: |
| 64 | + |
| 65 | +- restrict admin endpoints |
| 66 | +- define required client auth methods |
| 67 | +- keep secrets in runtime config (not baked into images) |
| 68 | + |
| 69 | +## FAQ (starter set) |
| 70 | + |
| 71 | +### How does bidirectional sync work here? |
| 72 | + |
| 73 | +Changes flow between ObjectBox clients and MongoDB in both directions via the Sync Server + connector. |
| 74 | + |
| 75 | +### Where do I configure MongoDB URL / DB name? |
| 76 | + |
| 77 | +Either via CLI parameters (e.g. `--mongo-url`, `--mongo-db`) or in the Sync Server configuration file. |
| 78 | + |
| 79 | +### What should I monitor in production? |
| 80 | + |
| 81 | +At minimum: sync backlog/latency, connector logs, server resource usage, and error/retry rates. |
| 82 | + |
| 83 | +## Next steps |
| 84 | + |
| 85 | +- MongoDB tutorial (MongoDB-authored): |
| 86 | + https://dev.to/mongodb/mongodb-data-sync-for-offline-first-apps-keep-data-in-sync-with-objectbox-and-mongodb-atlas-34k8 |
| 87 | +- Connector docs: https://sync.objectbox.io/mongodb-sync-connector |
| 88 | +- Configuration docs: https://sync.objectbox.io/sync-server/configuration |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +**Related docs:** If you want to start from ObjectBox Sync first, begin here: <Link to="https://sync.objectbox.io/">sync.objectbox.io</Link> |
0 commit comments