17 comments

[ 3.0 ms ] story [ 51.6 ms ] thread
Looks great! Does this have something to do with the official SQL support that Mateor has in the pipeline?
If you're not using meteor, but are interested in using this in node, take a look at the library it's built on: https://github.com/numtel/pg-live-select

At a glance it looks like it creates triggers on the fly and tears them down. I'm curious how scaleable this is, is trigger creation a locking activity in postgres?

Creating views and triggers on the fly does sound like insanity. There's got to be a better way.
Create triggers, fire all events off to a proper message broker for fanout.

Events can be triggered directly in PG using an extension for AMQP or something, or in a standalone service, using whatever you can dream up.

There is: logical decoding http://www.postgresql.org/docs/9.4/static/logicaldecoding.ht... I wonder why the author chose to waste time on this instead of doing things the proper way.
I'd guess ignorance? I'd never heard of 'logical decoding' before and the name of the feature doesn't lend itself to easy understanding.

That said, thanks for pointing this out - it looks like yet another very useful PG feature!

At times it feels as if the entire Nosql industry was created by people not reading the Postgresql manual.

edit: thanks for the link to logical decoding, looks very useful.

Logical decoding was only recently added in Postgres (9.4)? I'm not sure on the privileges required for logical decoding in postgres, but typically it requires 'root' access because it lets you see all the data in the system. So triggers can often be used on a shared database, where you might not be allowed to access the transaction log.
(comment deleted)
There was (or is?) also fork of PostgreSQL which implemented streamed queries.

It was way ahead it's time, maybe it's dead by now. But they still have the site here, weirdly named TelegraphCQ: http://telegraph.cs.berkeley.edu/

Direct link to 2.1 last version: http://telegraph.cs.berkeley.edu/telegraphcq/v2.1/

Interesting... I'll take a look at this.

It would be awesome to write a Postgres extension in C to implement Live Selects directly. Due to this project's developmental legacy this was considered from the start but is definitely on my radar.

This is a cool hack, but no latency compensation or database only on the server. I would rather use a package that adhered to the core principles of Meteor.
Agreed. Can't wait for the baked-in psql support in Meteor.
Whether this is the right approach or not, I'm glad to see people trying to make the meteor sql support happen. Many people aren't really to adopt Meteor unless it has sql support.
I think it's great to see this. I was really impressed by the insight/design of allowing the user to specify the invalidation functions, rather than trying to solve the (very difficult) problem of automatically determining the exact set of invalidation criteria. It may be that the user can determine a better invalidation function anyway, because they have domain-specific knowledge (e.g. how often a table changes).

(I'm a meteorite, but commenting in my personal capacity)