CouchDB offers three distinct APIs for querying documents. It also comes up with an API to track changes happening in a database.
I’ve written 3 articles to explain how to use these APIs in real-time web applications, using the _changes API that is available through a keep-alive socket.
They describe the flow of requests needed to fetch the documents, keep them up-to-date with the database, and when available, update the database when changes happened on the client side:
Also note that these articles reflect how Emily CouchDBStore works, in combination with Transport