
Reactive PostgreSQL for Meteor - taylorwc
https://github.com/numtel/meteor-pg
======
netghost
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](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?

~~~
buckbova
Creating views and triggers on the fly does sound like insanity. There's got
to be a better way.

~~~
nunwuo
There is: logical decoding
[http://www.postgresql.org/docs/9.4/static/logicaldecoding.ht...](http://www.postgresql.org/docs/9.4/static/logicaldecoding.html)
I wonder why the author chose to waste time on this instead of doing things
the proper way.

~~~
ivarv
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!

~~~
hammerandtongs
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.

------
justinsb
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)

------
pinouchon
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.

------
Ciantic
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/](http://telegraph.cs.berkeley.edu/)

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

~~~
numtel
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.

------
McDoogle
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.

~~~
taylorwc
Agreed. Can't wait for the baked-in psql support in Meteor.

------
joeyspn
Looks great! Does this have something to do with the official SQL support that
Mateor has in the pipeline?

~~~
Everhusk
I don't think this was developed by MDG [1]. Just as amazing work though!

[1] Author - [https://numtel.github.io/](https://numtel.github.io/)

