CouchDB has an http interface that makes it accessible from the server and from the client. Does anything like this exist with a websocket interface?
Thanks in advance for any info!
CouchDB has an http interface that makes it accessible from the server and from the client. Does anything like this exist with a websocket interface?
Thanks in advance for any info!
In general you don't want to expose your database server directly via a public interface, so there would be a server application in between providing authentication and services like websockets. Typically that would be something like node.js or Tornado .. but since you're aware of that based on your question tags, what is the actual solution you're looking for?
CouchDB currently does not directly support a websocket interface, but the next release (1.3) apparently includes support for the Server Sent Events protocol which is widely supported except for IE (see: browser compatibility).
It looks like CouchDB supports EventSource feed type for _changes
:
https://issues.apache.org/jira/plugins/servlet/mobile#issue/COUCHDB-986
Description
I'll implement EventSource protocol feed for _changes API (feed="eventsource").
Some info about it: http://dev.w3.org/html5/eventsource/ It's more useful than websocket, beacause it's read-only.
Also: consider https://github.com/nolanlawson/socket-pouch:
SocketPouch a custom PouchDB adapter that proxies all PouchDB API calls to another PouchDB running on the server in Node.js. The communication mechanism is Engine.io, the famous core of Socket.io.
This means that instead of syncing over HTTP, SocketPouch syncs over WebSockets. Thanks to Engine.io, it falls back to XHR polling in browsers that don't support WebSockets.
PouchDB is a port of CouchDB in JavaScript, meant to run inside the browser (for running a CouchDB database in the browser) or/and Node.js (as a lightweight substitute or complement for CouchDB)