Scenario 25.1.8 · SR across regions: failover to the DR registry
Schema Registry DR: failover to a follower-only registry
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 playgroundtwo 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-onlyO1 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 drprimary 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 downdr 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 SRprimary 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 lostregistration 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 drSR 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 drv2 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 drWhat 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
Troubleshooting
More in Schema registry
- Confluent Schema Registry subjects and versions for Kafka
- Kafka schema compatibility: BACKWARD vs FORWARD vs FULL
- Kafka breaking schema change rejected by Schema Registry
- Kafka Schema Registry down: why warm clients keep going
- Kafka Schema Registry down: a restarted client stops
- Highly available Schema Registry: leader failover
- Schema Registry across two DCs: losing the leader DC
- Two independent Schema Registries break mirrored Kafka data
- Kafka producer schema rejected as incompatible (409)
- Kafka consumer cannot read a new schema under BACKWARD