# Is Replica Of Check Examples

Source: https://userguide.qualytics.io/data-quality-checks/is-replica-of/deep-dive/examples/

> **Warning: Deprecated: use Data Diff instead**
>
> The Is Replica Of rule is no longer maintained. [Data Diff](https://userguide.qualytics.io/data-quality-checks/data-diff/introduction/) replaces it with the same row-by-row comparison plus change-type filtering. This page is kept as a reference for checks that already exist; new checks should use Data Diff. Saving a check with the Is Replica Of rule, from the form or through the API, stores it as a **Data Diff** check.

One production scenario showing how an Is Replica Of check behaves when a replica drifts from its source. For new checks, the same scenario is better served by [Data Diff](https://userguide.qualytics.io/data-quality-checks/data-diff/deep-dive/examples/).

**Tab: Replica Drift**

**The situation:** A reporting replica of `NATION` is rebuilt nightly from the operational database. A failed load left the replica missing one row and holding a stale name on another. Row Identifiers are set on the primary key, so the anomaly can show which rows diverged.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | Is Replica Of |
| Fields | `N_NATIONKEY`, `N_NATIONNAME` |
| Filter | *(none)* |
| Row Identifiers | `N_NATIONKEY` |
| Passthrough Fields | *(none)* |
| Reference Datastore | `reporting` |
| Reference Container | `NATION_REPLICA` |
| Comparators | *(none)* |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Replication team)* |
| Description | Ensure NATION matches its replica. |
| Tags | `replication`, `legacy` |
| Additional Metadata | `jira: DATA-9601` |
| Status | Active |

**Payload**

```json
{
    "description": "Ensure NATION matches its replica.",
    "rule": "isReplicaOf",
    "fields": ["N_NATIONKEY", "N_NATIONNAME"],
    "container_id": 145,
    "filter": null,
    "properties": {"ref_datastore_id": 22, "ref_container_id": 803, "id_field_names": ["N_NATIONKEY"]},
    "tags": ["replication", "legacy"],
    "additional_metadata": {"jira": "DATA-9601"},
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 12
}
```

**Sample Data**

| N_NATIONKEY | Source N_NATIONNAME | Replica N_NATIONNAME |
| --- | --- | --- |
| 1 | ARGENTINA | ARGENTINA |
| 2 | BRAZIL | BRASIL |
| 3 | CANADA | *(missing)* |

**What gets flagged**

Nation `2` carries a stale spelling in the replica and nation `3` never arrived. The check reports a single Shape Anomaly for the container; the Comparison Source Records view lists both rows side by side, which is what Row Identifiers make possible.

> **Example: Shape Anomaly**
>
> 2 records differ between NATION (operational) and NATION_REPLICA (reporting)

**Flowchart**

```mermaid
graph TD
    A["Read both containers"] --> B["Pair rows on N_NATIONKEY"]
    B --> C{"Do the compared fields<br/>match on every paired row?"}
    C -->|Yes| D["Check passes"]
    C -->|No| E["Report one Shape Anomaly<br/>with the differing rows"]
```

**Equivalent SQL**

```sql
-- The rows an Is Replica Of check would surface.
SELECT s.n_nationkey, s.n_nationname AS source_name, r.n_nationname AS replica_name
FROM nation s
FULL OUTER JOIN nation_replica r ON s.n_nationkey = r.n_nationkey
WHERE s.n_nationname IS DISTINCT FROM r.n_nationname;
```

## See Also

- **How It Works**

  The complete reference: definition, field scope, Row Identifiers, Comparators, filter behavior, and why coverage does not apply.

  [How It Works](https://userguide.qualytics.io/data-quality-checks/is-replica-of/deep-dive/how-it-works/)
- **Anomaly Reporting**

  What the Shape Anomaly reports and how the differing rows are presented.

  [Anomaly Reporting](https://userguide.qualytics.io/data-quality-checks/is-replica-of/deep-dive/anomaly-reporting/)
- **Best Practices**

  Why to migrate to Data Diff, and how to keep an existing check useful until you do.

  [Best Practices](https://userguide.qualytics.io/data-quality-checks/is-replica-of/deep-dive/best-practices/)
- **Permissions**

  The team permission each action needs: view, create, edit, archive, restore, and delete.

  [Permissions](https://userguide.qualytics.io/data-quality-checks/is-replica-of/deep-dive/permissions/)

*Last updated: October 16, 2026.*
