3 ms·
I made this sample using SocketCluster (I'm the main author): https://github.com/socketcluster/sc-sample-inventory https://github.com/socketcluster/sc-sample-in
by jondubois 11y ago
I made this sample using SocketCluster (I'm the main author): https://github.com/socketcluster/sc-sample-inventory https://github.com/socketcluster/sc-sample-inventory - I wrote a basic realtime CRUD module/layer using SC's internal in-memory storage: https://github.com/SocketCluster/sc-sample-inventory/blob/master/sc_modules/realtime-rest.js https://github.com/SocketCluster/sc-sample-inventory/blob/ma....
That was just for experimenting, now I'm working on a proper version using RethinkDB with a better realtime CRUD interface. My solution doesn't rely on RethinkDB's changefeed feature though, so you should be able to implement a similar binding for any database. WORK IN PROGRESS: https://github.com/SocketCluster/sc-crud-rethink https://github.com/SocketCluster/sc-crud-rethink
Basically, the realtime pub/sub layer sits directly on top of the database such that any change made to the database must pass through that layer (The pub/sub layer is responsible for notifying relevant subscribers - Not the database).