a glob of nerd­ish­ness


published by natevw on

Two browsers walk into a bar. The bartender introduces them, then the horse says to the Ukrainian: "

PouchDB instances talking together


So anyway, you've maybe heard of PouchDB, an IndexedDB (and WebSQL and LevelDB and HTTP…) wrapper that is replication-compatible with CouchDB. And maybe you've heard also of WebRTC, a browser API for "real-time communication" between peers.

Well, I combined the two.

It's called PeerPouch and it seems to work. In theory and practice. Basically it adds still another backend to PouchDB, which proxies all calls on the local instance to one on another peer. Connection setup itself is done via a PouchDB/CouchDB instance too. So it's Pouches all the way down.

CouchDB's all the way down

I'm worried there's no easy-win use case due to the usability issues of combining browser storage (confusing) with peer-to-peer connections (uncertain) while still requiring mutual access to a central server (there's always a catch), but PeerPouch could be helpful for things like:

PeerPouch itself is super simple to use. So I'm thinking combined with an in-memory PouchDB backend it could join the ranks of WebRTC wrappers for generic chat/game/whatever apps disregarding the data storage PouchDB usually offers. The advantage would be not require anything more than a potentially-free IrisCouch or Cloudant pre-hosted server backend for signalling.

To demo/test it, I built a no-frills direct file transfer utility which I hope to get hosted once I get a suitable server backend ready for shared public consumption. Metakaolin is also high up on the list for some peerish collabification. Have you got any projects where this might be useful?

blog comments powered by Disqus HTTP/1.0 500 Internal Server Error Cache-Control: must-revalidate Connection: close Content-Length: 60 Content-Type: application/json Date: Sat, 22 Jul 2017 00:34:50 GMT Server: CouchDB/2.0.0 (Erlang OTP/19) X-Couch-Request-ID: d6c1fa8c31 X-Couch-Stack-Hash: 2053811356 X-CouchDB-Body-Time: 0 {"error":"unknown_error","reason":"undef","ref":2053811356}