Search code examples
amazon-s3synchronizationcouchdbofflinecouchbase-lite

Synchronize files between Couchbase-lite Couchdb and Amazon S3


I am working on a project to allow offline first UX, I am using CouchDB as remote database and Couchbase Lite as a local database on iOS app.

My scenario: When there is no internet connectivity, all data is stored locally, When internet comes back data is synchronized with remote CouchDB database see attached architecture diagrame (Nginx here is used as revers proxy) enter image description here

I am able now synchronize all json data stored couchbase lite with Couchdb. However it not recommended to keep files in a database instead I need to store them in a storage platform like Amazon S3.

How can I perform this synchronization while keeping all files stored in Amazon S3?


Solution

  • The latest version (1.2) of Couchbase Lite has improved support for attachments. So you can add your images as attachments in your data model. And can now control whether they get downloaded automatically or manually with the CBLReplication downloadsAttachments flag.