> For the complete documentation index, see [llms.txt](https://docs.adiom.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adiom.io/basics/faq.md). Agents can also search and read this documentation through its [MCP server](https://docs.adiom.io/~gitbook/mcp).

# FAQs

<details>

<summary>What permissions do I need on the source or destination?</summary>

Simple read on the source and write on the destination should suffice.

For precise resume token creation on the source (highest consistency guarantee), write permission is necessary to inject a dummy record.

</details>

<details>

<summary>Can I write on the source while dsync is running?</summary>

Yes.

</details>

<details>

<summary>Can I stop dsync and resume later?</summary>

Yes, you can as long as you're using the -m option to store the metadata for the data flow, or using the Enterprise (Temporal-based) version. Then dsync will not repeat already completed tasks, and will automagically resume from the latest in-progress task. This is applicable both to the initial data copy and change-data-capture (CDC).

</details>

<details>

<summary>How can I restart the process from scratch?</summary>

1. Delete the data on the destination
2. Clean up dsync metadata by running it with the `--cleanup` option.

</details>

<details>

<summary>How fast is dsync?</summary>

Dsync offers several different load levels that allow users to control the internal level of parallelism when reading data from the source and writing to the destination. Outside of that, the sync performance will depend on the following factors:\
1\) Provisioned/available capacity of source and destination databases\
2\) Network bandwidth\
3\) Record/row/document size\
4\) CPU allocated to dsync

As reference data points, consider below:

* 97GB migration with 55M documents and 200-500 writes/sec from Cosmos DB to MongoDB took 11 minutes
* 334GB migration with 45M documents took \~1.5 hours

</details>

<details>

<summary>What instance size should I use, and how many Dsync instances do I need?</summary>

It depends on which version you run:

* **Dsync (open source)** runs as a single instance. You can only scale it up by giving it more CPU and RAM.
* **Dsynct (Enterprise)** spreads one migration across many Dsync instances, called workers, coordinated by Temporal. You can add or remove workers while the migration is running. If you're not familiar with it, see [Scalable Deployment](https://docs.adiom.io/enterprise/scalable-deployment.md).

Either way, start with a short test run on a single instance, such as a VM or container with 4 CPU and 16 GB RAM. For Dsynct, you can run the test in [simple mode](https://docs.adiom.io/enterprise/running-dsynct/running-dsynct.md#no-temporal), which doesn't need Temporal. During the test, measure two things:

1. **Throughput per CPU.** Take the steady-state docs/sec from the progress report (for Dsynct, also the `dsynct.written` counter in [observability](https://docs.adiom.io/enterprise/running-dsynct/observability.md)) and divide it by the number of CPUs the instance has.
2. **Read impact on the source.** Watch CPU, IO and consumed throughput (RU/s, RCU, etc.) on the source while the test runs.

Then calculate the number of CPUs you need:

```
CPUs = document count / (desired migration duration in seconds × throughput per CPU)
```

For example, migrating 20 billion documents in 12 hours (43,200 seconds) at a measured 20,000 docs/sec per CPU requires 20,000,000,000 / (43,200 × 20,000) ≈ 23 CPUs.

To turn CPUs into instances, use 4 CPU and 16 GB RAM, or 8 CPU and 32 GB RAM, per instance (see [Infrastructure Requirements](https://docs.adiom.io/basics/deploy.md#infrastructure-requirements)):

* **Dsync:** if you need 8 CPUs or fewer, a single instance of that size is enough. If you need more, allow more time for the migration or use Dsynct.
* **Dsynct:** divide the CPU count by 4 or 8 to get the number of workers. In the example above, that is 6 workers with 4 CPUs each, or 3 workers with 8 CPUs each.

Keep in mind:

* **Migration duration is the variable.** Pick a target and see how many CPUs it requires. If the number is too high, allow more time.
* **Read impact on the source is the constraint.** Load on the source grows roughly in proportion to the number of CPUs working on the migration. If the source can't take the load needed for your target duration, use fewer CPUs (a smaller Dsync instance or fewer Dsynct workers) and allow more time.
* **Throughput per CPU depends on your environment.** Destination capacity, available read capacity on the source, and document size all affect it. If either database is the bottleneck during the test, adding CPUs won't make the migration faster, so measure again after you change database capacity.

**CDC with Dsynct.** After the initial copy finishes, Dsync only replicates ongoing changes, which usually needs far fewer workers. You can stop workers while the migration is running, and their tasks are reassigned to the remaining workers. You can also run a separate group of workers just for CDC and size it on its own:

1. Start the job with `dsynct run --queue-name main --initial-sync-queue-name bulk --stream-queue-name cdc ...`.
2. Start the initial copy workers with `dsynct worker --queue-name bulk ...` and the CDC workers with `dsynct worker --queue-name cdc ...`.
3. Keep at least one worker with `--queue-name main` running for the whole job. It runs planning and coordination, which stay on the main queue.
4. Start the CDC workers at the beginning of the job, not after the initial copy. Some sources, such as MongoDB, run a change-tracking task on the CDC queue during the initial copy.

When the initial copy finishes, stop the `bulk` workers. All workers in every group must use the same source, destination and transform configuration.

</details>

<details>

<summary>What security or auth options are supported?</summary>

Dsync uses regular APIs for connecting to source and destination databases, such as [MongoDB Go Driver](https://www.mongodb.com/docs/drivers/go/current/) for MongoDB. All standard auth options are supported.

</details>

<details>

<summary>How do I start dsync in a highly-available configuration?</summary>

You can run it as a docker container with a sensible restart policy.

</details>

<details>

<summary>Docker?</summary>

<https://github.com/adiom-data/dsync/blob/main/Dockerfile>

</details>

{% hint style="info" %}
For any other questions not included in this FAQ section, contact us in [Discord](https://discord.gg/r4xzVfMQeU).
{% endhint %}
