4 ms·
Reading the WAL is interesting. I've been other tools [1] accomplish similar ends using Postgres triggers [1]: https://github.com/hasura/graphql-engine/blob/ma
by adamfeldman 7y ago
Reading the WAL is interesting. I've been other tools [1] accomplish similar ends using Postgres triggers
[1]: https://github.com/hasura/graphql-engine/blob/master/event-triggers.md https://github.com/hasura/graphql-engine/blob/master/event-t...
- kiwicopple 7y agoHasura is an amazing tool. I tried with triggers + NOTIFY at the start, which was how Hasura does it (at least last I looked). I ran into the limitations of NOTIFY, which can only have a 8000 byte payload. The recommended resolution online was just to send a NOTIFY with a Primary key or identifier, then to query the database for the resource that changed. I didn't like this approach because it required more load on the database. One other advantage of using the WAL is that you don't have to set up then triggers everytime you set up a table. You just set and wal_level to "logical" on the database and then all your tables will be included in the stream replication