N
Neon7mo ago
rival-black

WAL changes without polling?

Is it possible to subscribe to the WAL change stream with a websockets client in cloudflare durable objects?
5 Replies
genetic-orange
genetic-orange7mo ago
It's not possible to do this directly at the moment. You can use a tool to replicate data from Neon and then subscribe to the changes https://neon.tech/docs/guides/integrations#replicate-data-from-neon
Neon
Neon integration guides - Neon Docs
Monitor Deploy Serverless Query Develop Replicate data from Neon Replicate data to Neon Schema Migration Authenticate
rival-black
rival-blackOP7mo ago
I managed to work out a pretty nice polling solution but it would be great if the wal2json output could be streamed to subscribers over websockets. Maybe you guys could use durable objects for this!
genetic-orange
genetic-orange7mo ago
Ouh would love to learn more about your polling solution
rival-black
rival-blackOP7mo ago
have a look!
rival-black
rival-blackOP7mo ago
pretty much just connects to neon and sets up a replication slot if it's not already there and then polls the wal2json output to get for new entries and if found advances the LSN

Did you find this page helpful?