Thursday, September 17, 2026

Google Spanner Omni DB; Paxos replication protocol

famous Google cloud db can now run on premise, too, as a single exe file!

Spanner Omni | Google Cloud

Spanner Omni is a self-managed database that utilizes Paxos-based synchronous replication and a software-only TrueTime API to deliver global ACID transactions and high availability across distributed servers.



What is Paxos-Based Synchronous Replication?

Paxos is a foundational distributed consensus algorithm designed to help a cluster of independent computers agree on a single value or state, even if network partitions occur or individual nodes fail. Paxos-based synchronous replication applies this algorithm to database design. It requires that before any write transaction is finalized and acknowledged to the client, a strict majority (quorum) of the replicas must formally vote to accept and persist the update.

How It Works: Roles and Phases

The algorithm functions by dividing responsibilities into three distinct roles (though a single database node typically performs all three simultaneously):
  • Proposers: Receive write requests from the application and propose them to the rest of the cluster.
  • Acceptors: Evaluate and vote on the proposals. A response from an acceptor signifies its agreement to store that specific value.
  • Learners: Execute the final agreed-upon value and apply it to their local storage once consensus is finalized.

To safely reach this consensus, the protocol generally executes in stages:
  1. Prepare: A proposer establishes leadership (using a unique sequence or ballot) and checks if the network has already committed to a previous value.
  2. Accept: The proposer submits the new data value for the acceptors to vote on.
  3. Commit: Once a majority of acceptors agree, the value is officially chosen, and the learners commit the change to the database log.

The Trade-offs of Synchronous Consensus

  • Strong Consistency: Because a quorum must agree before a write is completed, the replication is inherently synchronous. This guarantees strict consistency (linearizability)—ensuring that any subsequent read operation instantly reflects the latest write across the distributed system.
  • Fault Tolerance: The system remains highly available as long as a majority of nodes are online. In a standard 5-node cluster, the database can seamlessly survive the failure of 2 nodes without data loss or downtime.
  • Increased Latency: The primary drawback is speed. Gathering votes across a network (especially a geographically distributed one) takes time, resulting in higher write latency compared to simple asynchronous leader-follower replication.

Real-World Example: Google Spanner

As highlighted in the Software Engineering Daily episode, this distributed consensus protocol is the absolute core of Google's globally scaled database architecture. Spanner utilizes Multi-Paxos, an optimized variant that uses a stable leader to efficiently handle a continuous log of transactions rather than running the full voting phase for isolated values. This architecture ensures global synchronization, extreme scale, and ironclad data durability.


excellent podcast interview!

Inside Google's Database Infrastructure for the AI Era - Software Engineering Daily

Sailesh Krishnamurthy | LinkedIn

Here is a summary and key takeaways from Episode 1960 of Software Engineering Daily, featuring guest Sailesh Krishnamurthy (VP of Engineering for Databases at Google Cloud / Alphabet) and host Matt Merrill:

Executive Summary The core contract of database architecture is fundamentally shifting due to AI. Historically, operational databases functioned as deterministic systems of record built to guarantee exact query results and never lose data. In the AI era, databases are becoming "systems of action" where applications require structured and unstructured data to be queried together. Data retrieval is moving toward search-like semantics—relevance, context, ranking, and hybrid search—where systems must process non-deterministic queries and support autonomous agents dynamically.

  • Evolution of Database "Dogma":
    • For 50 years (since the original SQL paper in 1974), database design focused on declarative queries and exact results.
    • AI forces a mindset shift from exact deterministic matching to probabilistic information retrieval (relevance and ranking).
  • Spanner Innovations & Spanner Omni:
    • Architecture: Spanner relies on distributed storage (Colossus) to scale out via metadata copies rather than expensive data transfers.
    • Spanner Omni: Brings Spanner capability on-premises, to other clouds, or hybrid setups by collapsing microservices into a single executable.
    • Software TrueTime: Replaces specialized hardware atomic clocks with "Software TrueTime" to manage time deltas ($\epsilon$) across non-Google infrastructure.
    • Native Graph & PageRank: Allows developers to overlay graph semantics (CREATE PROPERTY GRAPH) on existing relational tables in c2, running algorithms like PageRank natively for real-time fraud detection without ETL pipelines.
  • AlloyDB & Advanced Vector Retrieval:
    • Uses Google’s ScaNN tree-based index algorithm, achieving up to 6x faster vector queries and 4x less memory consumption than standard Postgres HNSW.
    • Filtered Vector Search: Adapts query execution on the fly to solve post/pre-filtering issues when combining vector embeddings with relational predicates (e.g., price filters).
  • Data Modeling & Agent Governance:
    • Context Over Schema: For LLMs and agents, traditional table schemas are insufficient; rich metadata and semantic context must be extracted from data columns.
    • Parameterized Secure Views (PSVs): Address the security gap where three-tier apps isolate user logic in code rather than the database. PSVs enforce user-level security barriers directly in SQL DDL so AI agents cannot execute unauthorized queries or data exfiltration attacks.
  • Embracing Non-Deterministic Systems:
    • Engineering teams must transition from attempting to make AI fully deterministic to managing probabilistic outcomes using continuous evaluation frameworks (evals).
  • Industry Trajectory: A look at how database infrastructure has evolved over the past 50 years and where it is heading as AI reshapes data architecture.


No comments: