Yes, it might be good to delete the local database of users who haven't logged in for a certain period of time (say 30 days for example). But you could also just delete the database on logout and when the user logs back in all the documents which this user has access to will be replicated again. It depends on how often you expect users to log in and out on the same device.
James On Monday, 12 June 2017 14:56:13 UTC+2, [email protected] wrote: > > If we maintain user wise database at iOS end then it will be a manual > effort to remove databases related to other users that were previously > logged in on that device, isn't it? > > On Monday, June 12, 2017 at 4:29:59 PM UTC+5:30, James Nocentini wrote: >> >> You should use different databases for each user. A common pattern is to >> use the username as the database name (U1, U2, U3). So when the user logs >> in, the app will open (or create) the database which contains the data >> specific to that user. >> >> James >> >> On Monday, 12 June 2017 12:32:43 UTC+2, [email protected] wrote: >>> >>> For a chat iOS application using Couchbase lite with Couchbase server >>> having support for channeling. The channeling is implemented such that two >>> users doing chat will receive chat messages relevant to each other and not >>> related to other users. For example for a three device system (D1, D2, D3) >>> with logged in users U1, U2, U3. When user U1 (on device D1) chats with U2 >>> (on device D2) then they receive chat messages as expected and both the >>> devices contain data related to this chat. If now user U1 logs out and user >>> U3 logged in on device D1 and start chatting with user U2. In this case >>> what about the data which is already present on device D1 (related to chat >>> between U1 and U2)? Will Couchbase lite automatically remove this data from >>> device D1? The older data should be removed from device D1 since it is not >>> as per the current channeling setup. >>> >>> Thanks >>> >> -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/2e2dd75a-2af2-4ec9-9cca-c1aae0a93bd5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
