Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PostgreSQL
  3. Spock

Spock

NOASSERTIONC

A PostgreSQL extension providing logical multi-master replication for high availability and write scalability.

Visit WebsiteGitHubGitHub
710 stars46 forks0 contributors

What is Spock?

Spock is a PostgreSQL extension that provides logical multi-master replication, enabling multiple PostgreSQL database nodes to accept writes and synchronize changes bidirectionally. It solves the problem of building highly available, active-active database clusters where each node can serve read and write traffic, improving fault tolerance and write scalability.

Target Audience

Database administrators, DevOps engineers, and developers building distributed, highly available PostgreSQL deployments, especially those needing multi-region or active-active setups.

Value Proposition

Developers choose Spock because it offers a native, extension-based approach to multi-master replication for PostgreSQL, with SQL-driven configuration, conflict resolution, and DDL replication support, avoiding reliance on external middleware or proprietary solutions.

Overview

Logical multi-master PostgreSQL replication

Use Cases

Best For

  • Building active-active PostgreSQL clusters for high availability
  • Geographically distributed databases requiring local writes
  • Scaling write workloads across multiple database nodes
  • Disaster recovery setups with multiple writable replicas
  • Migrating from single-master to multi-master PostgreSQL architectures
  • Implementing bidirectional data synchronization between PostgreSQL instances

Not Ideal For

  • Projects needing quick deployment without patching PostgreSQL source code
  • Environments with heterogeneous schemas or varying table structures across nodes
  • Teams seeking a fully managed replication service without deep PostgreSQL administration

Pros & Cons

Pros

Active-Active Replication

Enables multiple writable PostgreSQL nodes with bidirectional synchronization, supporting high availability and write scalability, as highlighted in the multi-master replication feature.

Automatic DDL Replication

Propagates schema changes like CREATE/ALTER TABLE across the cluster when enabled via GUC settings, simplifying schema management, as stated in the configuration steps.

SQL-Driven Configuration

Allows creation and management of nodes and subscriptions using SQL functions such as `spock.node_create`, making it intuitive for PostgreSQL users, detailed in the basic usage examples.

Built-in Conflict Resolution

Includes mechanisms to detect and handle data conflicts using commit timestamps, essential for multi-master setups, mentioned in the conflict resolution feature and configuration requirements.

Cons

Complex Build Process

Requires patching PostgreSQL source with version-specific patches applied in numerical order, making installation more involved than standard extensions, as described in the building steps.

Rigid Schema Requirements

Mandates identical table names, schemas, columns, and primary keys across all nodes, which can be restrictive for diverse or evolving databases, as noted in the prerequisites.

Irreversible Upgrades

Upgrades cannot be rolled back due to catalog changes, necessitating backups and adding operational risk, highlighted in the upgrading section.

Frequently Asked Questions

Quick Stats

Stars710
Forks46
Contributors0
Open Issues15
Last commit13 hours ago
CreatedSince 2022

Tags

#logical-replication#high-availability#distributed-databases#database-replication#postgresql#postgresql-extension

Built With

P
PostgreSQL
C
C++

Links & Resources

Website

Included in

PostgreSQL11.8k
Auto-fetched 13 hours ago

Related Projects

stolonstolon

PostgreSQL cloud native High Availability and more.

Stars4,815
Forks449
Last commit1 year ago
autobaseautobase

Automated database platform for PostgreSQL® - Your own DBaaS.

Stars4,163
Forks584
Last commit2 days ago
repmgrrepmgr

A lightweight replication manager for PostgreSQL (Postgres)

Stars1,691
Forks263
Last commit1 month ago
pg_auto_failoverpg_auto_failover

Postgres extension and service for automated failover and high-availability

Stars1,340
Forks133
Last commit5 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub