HNHacker News
TopNewBestAskShowJobs

azr89

12 karma · joined December 5, 2016

submissionscomments
azr89··on PouchDB, the JavaScript Database That Syncs
Yup, hosting it ourselves. Its a peach. There are few things that it doesnt come with out of the box - clustering, Full text search, geoindexing, chained map reduce, auto compaction, index auto-updation. Once thats done, if anything it was more forget about it than Cloudant, which bills on requests / thoroughput. This can catch you out because continuous replications between databases on the same cloudant account are also counted as requests and billed as such. And continuous replication is very chatty. So if you have a particularly creative multi-master setup, like a per user db -> masterdb kind of thing going, this can eat up your thoroughput / push up your bills with no practical benefit.

Its really openresty + couch that does it for me. The idea of writing security / validations / routing etc right into ngnix combines beautifully with the CouchDB way of thinking.

azr89··on PouchDB, the JavaScript Database That Syncs
+1 for the community. Everyone who's worked with Pouch/Couch seems to become an evangelist eventually, which speaks volumes for how well designed the platforms are (Flaws and all). People genuinely seem to enjoy working on them, and they solve real problems in very neat and interesting ways.
azr89··on PouchDB, the JavaScript Database That Syncs
We've been using Pouch in a progressive web app designed to be used on the field in remote locations, and while there was a learning curve in understanding how the replication protocol works, and as highlighted in another comment the way Chrome stores data for a web app - we can't be happier with pouch/couch.

Additionally, moving out of Cloudant and into CouchDB with an openresty based reverse proxy has made things even better, and really fun. This is one of those stacks that feels easy and simple at the same time. (Ref:https://www.infoq.com/presentations/Simple-Made-Easy).

azr89··on PouchDB, the JavaScript Database That Syncs
1:

replicates from mydb1 into the pouchdb object represented by 'db'

2 & 3:

I'm pretty sure chaining replications doesn't work in that way, although thats a pretty interesting thought.

If you have to chain replications and achieve the structure in 2, you'd have to define the pouch objects as:

db = new PouchDB('localDB');

mydb1 = new PouchDB('http://example.com/mydb1');

etc ..

and then do:

mydb2.replicate.to('mydb3',{live:true});

mydb2.replicate.to('mydb1',{live:true});

mydb1.replicate.to('db',{live:true});

the 'live' flag, as you'd imagine, makes the replication live/continuous, as opposed to one-time.