YugabyteDB Active-active

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a yugabytedb active active system by linking two or more clusters. Each cluster then accepts local reads and writes and sends updates to the others. Teams often build this layout to survive region failures and lower app lag. Still, teams often share broad admin roles across every region during the build. If a developer runs a bad update in one cluster, that change spreads fast. How a yugabytedb active active setup works YugabyteDB gives teams two main paths for multi-region writes.

Active Directory: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up a yugabytedb active active system by linking two or more clusters. Each cluster then accepts local reads and writes and sends updates to the others. Teams often build this layout to survive region failures and lower app lag. Still, teams often share broad admin roles across every region during the build. If a developer runs a bad update in one cluster, that change spreads fast.

How a yugabytedb active active setup works

YugabyteDB gives teams two main paths for multi-region writes. The first path uses a single stretched cluster across three or more regions. This setup uses synchronous replication so every write waits for a majority of nodes. Your data stays strict and consistent, but cross-region network lag slows down each write.

The second path links two separate clusters with asynchronous replication. Each region runs its own cluster and takes local writes at high speed. A background stream sends data changes from the source tables to the target tables. You can set this stream to run in one direction or both directions.

When both clusters write to the same tables, conflicts can happen. Two users in different regions might update the same row at the same time. The database resolves this conflict by letting the last write win based on time. Teams must keep system clocks in sync so the right update wins.

Schema changes also need extra care in a two-way setup. You must apply table updates to both clusters in the right order. Teams also need clear database roles for the people who manage these streams.

What native roles solve and what they miss

YugabyteDB uses role-based rules that look and work like standard Postgres roles. You can create specific roles for apps, data analysts, and database admins. You can also require network encryption and client certs for every user login. These native tools do a great job of deciding who can log in.

Active Directory: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, static database roles only check permissions at the table or schema level. Once an engineer logs in with a write role, every query runs unchecked. In a two-way replication setup, one bad delete statement wipes data in all regions. Native roles cannot pause a dangerous query so a teammate can check it first.

Sharing database passwords across multiple clusters also creates extra work for your security team. When an engineer leaves the team, you must rotate keys across every cluster. Native logs also store audit files on individual nodes across different regions. Pulling those logs together to see who ran a query takes hours of work.

Finally, native permissions do not rewrite sensitive fields inside query results on the fly. If a support engineer checks a live table, raw emails and phone numbers appear. Teams need a way to mask sensitive fields like card numbers or national IDs. Controlling individual statements in flight keeps multi-region data safe during daily debugging.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How does YugabyteDB handle write conflicts in two-way replication?

The database compares the timestamps of both writes and keeps the newest change. You must keep node clocks synced so the system picks the right update.

When should we use stretched clusters instead of asynchronous clusters?

Use a stretched cluster when your app needs strict consistency on every read. Use separate clusters when you need fast local writes in two regions.

How can teams protect sensitive data during live database checks?

Teams use dynamic data masking to rewrite emails, phone numbers, and card numbers in results. Engineers can run their checks while sensitive fields stay hidden in the output.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.