function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Riadh MRiadh M 

Is there any alternative to SmartStore for persistent storage?

I'm looking for a way to store Salesforce data locally in a mobile device. Smartstore is awesome, but the problem it deletes all Soups when we logout of the app. I reallly need to keep data on the mobile device even after logout.

Is there any alternative to Salesforce SmartStoe to do this ?

Hi , 

Looks like this is currently not possible, 

See the links below, 

Offline Storage

Offline storage is something I haven’t really worked with at all as a developer. I had read a bit and toyed with CoreData, Apple’s persistence framework, but nothing on a production level scale. Perhaps the most interesting piece of information about the Salesforce Mobile SDK’s implementation of offline storage was that they were leveraging an alternative to CoreData, rather than wrapping CoreData itself. They called this SmartStore, and it also sits on top of an SQLite database. Here is a good article by Model Metrics about it.

While most documentation regarding SmartStore references its use for Hybrid applications, it is also available for native applications as well. That is where I spent some time trying to figure out what the use cases were for a native developer to use SmartStore rather than CoreData, considering CoreData is the standard for local storage. I found a Salesforce blog that boiled it down to using SmartStore on native applications primarily to maintain parity with any Hybrid applications, but am still curious if there are any other benefits regarding performance or any other metrics (e.g. ease of use). From my brief work leveraging it, it didn’t necessarily seem any easier than using CoreData.

Using SmartStore with Native iOS

Storing Data Offline with Salesforce Mobile SDK SmartStore

Sync smartStore offline Data to Salesforce DB

Jacques LefebvreJacques Lefebvre

Is there any new development on this issue of clearing the db after logout?
If the user session expire, I suppose a logout clean is performed?

Any new solution to address this issue?


Steve ThistleSteve Thistle
Hi Jacques,

If you want to store data in the smartstore persistently you can use the global smartstore. This is not tied to a user account. The app developer is responsible for clearing the glable store when the data is no longer needed. 

Care must be taken when using this to ensure you don't store specific user data. From the link above
"Do not store user-specific data in global SmartStore. Doing so violates Mobile SDK security requirements because user data can persist after the user logs out."