title: CouchDB data synchronization
body: <p>I'm developing a TODO app for myself. It has to be offline first so data synchronization became a problem soon. As to my searches, CouchDB does data sync (replication) very well but I'm having some confusion here.<br>
  First of all, I'm using Flutter and Dart programming language and there isn't any couch client on Dart. For javascript, there is <a href="https://pouchdb.com/" rel="nofollow noreferrer">PouchDB</a> which apparently makes data sync with remote database automatic (<strong>Am I right?</strong>) as far as I know I should be good to go without any third party library since CouchDB comes with native HTTP API, I can just store user data as a JSON file and just sync it with CouchDB server as a document (<strong>Am I right?</strong>)<br>
  Another <a href="https://stackoverflow.com/questions/46351432/per-user-db-pouchdb-couchdb-shared-data-doable">confusion</a> <a href="https://www.joshmorony.com/part-2-creating-a-multiple-user-app-with-ionic-2-pouchdb-couchdb/" rel="nofollow noreferrer">for</a> <a href="https://docs.couchdb.org/en/stable/config/couch-peruser.html" rel="nofollow noreferrer">me</a> is that should user data be stored as a document or should I create 1 database per user(In other words does couch syncs database or document?) It also raises authorizations. A user which has access to a database has access to all documents. I want to restrict each user to its documents without placing another API between couch and end-user application.</p>