I have a Live Query, which data I have to use several time in my app (so I need to cache it). I see that QueryEnumerator is not thread-safe and moreover I have to call reset() method to read it again. This obliges me to have a copy of QueryEnumerator with type ArrayList or something like that. What I’m concerned is that if I have a lot of data, this will cause huge memory consumption. I don’t know exact structure of Couchbase Lite, does it cache anything or always reads from file. So maybe anybody have some ideas how to behave in this case? I need fast access to a data returned from Live Query, but I don’t want to have superfluous memory consumption.
I was thinking about caching only docs ids from queries results and then access to database with those ids. But I’m not sure about fastness of data access in this case.