

# How replication works
<a name="msk-replicator-how-replication-works"></a>

When you create a Replicator, MSK Replicator deploys all required resources in the target cluster's Amazon Region to optimize for data replication latency. MSK Replicator automatically copies all data from the cluster in the primary Amazon Region called *source* to the cluster in the destination Region called *target*. Source and target clusters can be in the same or different Amazon Regions.

Replication latency varies based on many factors, including the network distance between the Amazon Regions of your MSK clusters, the throughput capacity of your source and target clusters, and the number of partitions on your source and target clusters. MSK Replicator automatically scales the underlying resources so that you can replicate data on-demand without having to monitor or scale capacity.

By default, MSK Replicator copies all data asynchronously from the latest offset in the source cluster topic partitions to the target cluster. If the "Detect and copy new topics" setting is turned on, MSK Replicator automatically detects and copies new topics or topic partitions to the target cluster. However, it may take up to 30 seconds for the Replicator to detect and create the new topics or topic partitions on the target cluster. Any messages produced to the source topic before the topic has been created on the target cluster will not be replicated. Alternatively, you can configure your Replicator during creation to start replication from the earliest offset if you want to replicate existing messages.

MSK Replicator does not store your data. Data is consumed from your source cluster, buffered in-memory, and written to the target cluster. The buffer is cleared automatically when the data is either successfully written or fails after retries. All communication and data between MSK Replicator and your clusters is always encrypted in-transit. All MSK Replicator API calls like `DescribeClusterV2`, `CreateTopic`, `DescribeTopicDynamicConfiguration` are captured in Amazon CloudTrail.

MSK Replicator creates topics in the target cluster with a Replication Factor of 3. If you need to, you can modify the replication factor directly on the target cluster.

![\[MSK Replicator source and target clusters\]](http://docs.amazonaws.cn/en_us/msk/latest/developerguide/images/msk-replicator-diagram.png)
