Does replication stop automatically when there is no space left on the device?


#1

I guess it will get an exception and stop itself . right?
So the app should make some space and restart the replication.

Here come an architecture question:
Let say the device(app) should be able to work offline aswell and hold as many docs as possible.
What will be the proper way to sync a a large number of docs to a limited space devices?
Is that should be all in the hand of the sync server? Controlling the docs for a specific device? Making the sync gateway device aware?

Or does the device should take a roll in this game :
Let say the app can detect when it rich to a certain threshold and then stop the replication.
Now …it should make some space by removing old docs from its local db - How to do it without remove it from the server db?
Then the app should inform the server it has some additional space and want some additional docs… and start the replication?


#2

ForestDB on couchbase server can hold and index billions of documents. In Couchbase Lite 1.2 forestDB is now include as a storage option. How much storage is on the device with Couchbase Lite installed?


#3

Thanks,
Could you please point me out to a documentation about enabling this storage option?
Oren


#4

Let say 100 Mega. Is it really matter ? It is a general question.


#5

Step by Step Guide: http://blog.couchbase.com/2016/february/mobile-1.2-enable-forestdb


#6

ForestDB is an append only store so you will have to think about data size vs disk size. After you do a compaction actions , which can be automated or done by user, data size vs disk size will be closer together.

The benefit behind using forestDB is that query and write speed is about 2x faster then SQLite.

Now …it should make some space by removing old docs from its local db - How to do it without remove it from the server db?

The app will have to manage the data it writes as there is no LRU (Last Recently Used) method for delete data. When you mark an items as _deleted:true in CB Lite. The next time you compact the item will not be there, but it will be a part of its revision history _changes.

Then the app should inform the server it has some additional space and want some additional docs… and start the replication?

So the idea here is that you could potential have more data on your channel then you can store on the device itself. i.e only 100MB.
You will get exceptions. You could create a view by DateTime and delete older docs. Then replication will try its best to backfill via _changes.


#7

Does the compaction actions are done automatically by default at CBL 1.2 or it should be manually triggered?

Are you talking about out of space exceptions?
If I delete older docs (which I am not the owner of) from the device local db …does the replication will try to sync it again…? It is still on the channel …and still other devices needs it.