How does it get notified by PostgreSQL when the result of a query changes, since AFAIK PostgreSQL has no such built-in functionality? (it works if other apps change the database, right?)
How does it get notified by PostgreSQL when the result of a query changes, since AFAIK PostgreSQL has no such built-in functionality? (it works if other apps change the database, right?)
I dug into the code a bit and think it all happens here: https://github.com/hasura/graphql-engine/blob/master/server/... Which if my fledgling Haskell is correct digs into the subscription to find the sources and then adds a trigger on them.
On a related note, I've been very impressed with the Hasura GraphQL server. In particular how the authentication works with a JWT token and it's access restrictions seem pretty well thought out and flexible.
I have not yet used it in production but :fingers-crossed: it performs as well there as it has in testing and development
[0]: https://hasura.io/
Postgres actually has basic pubsub via "LISTEN" and "NOTIFY". I was planning on trying out rethinkdb as a real-time database but found that approach instead described in this blog post:
http://blog.sagemath.com/2017/02/09/rethinkdb-vs-postgres.ht...
which also had a huge comment thread with related links(800+ upvotes):