Railway

Deploy peerdb

peerdb template (by Chartcastr - data analyst you hire into slack)

Deploy peerdb

Just deployed

Just deployed

Just deployed

Just deployed

Just deployed

/var/lib/postgresql/data

Deploy and Host PeerDB on Railway

PeerDB is an open-source CDC (Change Data Capture) platform that replicates data from PostgreSQL to destinations like BigQuery, Snowflake, and S3 using native logical replication. It reads the Postgres WAL directly — no connectors, no Kafka, no Debezium — making it fast, simple, and Postgres-native.

About Hosting PeerDB

PeerDB runs as a 5-service stack: a PostgreSQL catalog database for internal metadata, a Temporal server for workflow orchestration, a flow-worker that reads the WAL and writes to your destination, a gRPC API server, and a web management UI. All services communicate over private networking. The only publicly exposed service is the UI dashboard, used to configure source/sink peers and manage CDC mirrors. This template provisions all five services with auto-generated credentials and pre-wired internal networking.

Common Use Cases

  • Analytics replication — replicate your production PostgreSQL tables to BigQuery or Snowflake for analytics, dashboards, and cross-referencing without impacting your production database
  • Real-time data warehousing — keep a near-real-time copy of your transactional data in a data warehouse with configurable sync intervals (default 60s)
  • Event sourcing and audit trails — capture every INSERT, UPDATE, and DELETE as versioned rows with soft-delete markers, giving you a complete change history
  • Cross-system data federation — make your Postgres data available in multiple downstream systems (BigQuery, S3, Snowflake, Kafka) from a single CDC pipeline

Dependencies for PeerDB Hosting

  • PostgreSQL source database with wal_level = logical enabled (Railway Postgres supports this)
  • Destination data warehouse — BigQuery, Snowflake, S3, or another supported PeerDB sink
  • GCP service account (if using BigQuery) with bigquery.dataEditor and bigquery.jobUser roles

Deployment Dependencies

Implementation Details

On the source PostgreSQL database, create a publication for the tables you want to replicate:

CREATE PUBLICATION my_cdc FOR TABLE "users", "orders", "events";

Then create a dedicated replication user:

CREATE USER peerdb_replicator WITH REPLICATION LOGIN PASSWORD '';
GRANT USAGE ON SCHEMA public TO peerdb_replicator;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO peerdb_replicator;

Once deployed, open the PeerDB UI to create your source peer (PostgreSQL), sink peer (BigQuery/Snowflake/S3), and CDC mirror.

Built and used in production by Chartcastr — automated SaaS analysis delivery to Slack.

Why Deploy PeerDB on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying PeerDB on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
NEW
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta