Monedula

Scenario 25.1.8 · SR across regions: failover to the DR registry

Schema Registry DR: failover to a follower-only registry

Schema registry · Advanced · about 5 min · Apache Kafka 4.4 · Confluent Platform feature

dr runs SR follower-only on a mirrored _schemas. After primary is lost it still serves lookups; registering needs an SR failover.

Run this scenario in the playground

v2 registered in dr. t+3.700s

v2 registers through sr-d1 as schema id 2, continuing the ids primary handed out.

Open at this step: step 8, v2 registered in dr

What you start with

Two regions, two Kafka clusters, one cluster link mirroring orders and _schemas from primary to dr. In dr, sr-d1 and sr-d2 read the mirrored _schemas and never lead, so dr knows every schema id primary assigned without being able to assign new ones.

Step by step

  1. two regions · dr runs SR follower-only t+0.000s primary and dr are separate Kafka clusters. A cluster link mirrors orders and _schemas into dr, where sr-d1 and sr-d2 read the mirrored _schemas: same schema ids, lookups only. Open at this step: step 1, two regions · dr runs SR follower-only
  2. O1 mirrored and read in dr t+0.900s The producer writes O1 in primary with schema id 1; the link copies it to dr, where c-dr decodes it. Open at this step: step 2, O1 mirrored and read in dr
  3. primary SR down t+1.100s sr-p1 and sr-p2 die; Kafka in primary is still up. Open at this step: step 3, primary SR down
  4. dr decodes without primary SR t+2.000s c-dr restarted with an empty cache. The mirrored O2 carries schema id 1, and sr-d1 knows it from the mirrored _schemas, so c-dr reads on. Open at this step: step 4, dr decodes without primary SR
  5. primary lost t+2.300s The whole primary region is gone. dr still has every record and schema mirrored so far. Open at this step: step 5, primary lost
  6. registration refused in dr t+2.700s Registering v2 in dr fails: its instances may not lead, and the mirrored _schemas is read-only. Open at this step: step 6, registration refused in dr
  7. SR failed over to dr t+3.300s The SR failover makes the _schemas mirror writable in dr and lets sr-d1 and sr-d2 lead. sr-d1 is elected. Open at this step: step 7, SR failed over to dr
  8. v2 registered in dr t+3.700s v2 registers through sr-d1 as schema id 2, continuing the ids primary handed out. Open at this step: step 8, v2 registered in dr

The takeaway

Mirroring _schemas keeps one schema-id lineage across regions: the DR side decodes mirrored data with no SR in primary. Writes need a deliberate failover - make the mirror writable and let dr's instances lead - just like the data topics.

Embed this scenario

Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.

<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=25.1.8" title="Kafka Simulator: SR across regions: failover to the DR registry" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/sr-follower-region-failover/">Schema Registry DR: failover to a follower-only registry</a></p>

Further reading

Confluent documentation

Troubleshooting

More in Schema registry

All scenarios