Following the production database with Neon

Hi there, congrats for the great work on Neon!

We’d love to switch to Neon for all our (for now) non-production use cases (ie. production on AWS RDS or similar, test/debug with live production data on Neon). Kinda similar to Frictionless development experience with Neon branching - Neon I guess

It’s not clear for us if we can subscribe the Neon instance to the vanilla Postgres production server?

I know that read replicas are not supported yet (Are read-replicas available in tech preview?). But I had the impression that this was about replicating a Neon database, not the other way around.
So, can the Neon compute be a standby/replica of a vanilla Postgres server (WAL Shipping)?
Or maybe alternatively it can be a subscriber of logical replication?

I also had the feeling that if this could be done, it would require self-hosting for now. Is it right?

Thanks in advance!

Hi, thanks for your interest!

It is pretty unlikely that we’ll support Neon instances as secondary to an external primary anytime soon. That is mainly because we updated the WAL format in a way that is not backward compatible with vanilla PostgreSQL, and we also currently don’t have the infrastructure in place to handle more than one version of the PostgreSQL WAL for a given instance: we wouldn’t be able to create writeable branches of the dataset.

Users are currently also not given the privileges required for (receiving) logical replication because (amongst other things) we are still working on hardening the execution environment of the PostgreSQL nodes.
Another complicating factor is that for replication to work swiftly, the receiver of the changes must receive these changes shortly after they were created, which doesn’t work well with the combination of PostgreSQL’s pull-based replication streams and our scale-to-zero policy for inactive nodes.

As it is right now, if you want to replicate your self-hosted PostgreSQL instance into Neon, you would have to host a proxy that pulls the changes from your Postgres logical replication stream and pushes them to Neon.

Hi Matthias,
Thanks a lot for the detailed answer. We’ll probably dig the proxy path then!

All the best