+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


JSONStore overview

JSONStore features add the ability to store JSON documents in MobileFirst applications.

JSONStore is a lightweight, document-oriented storage system that is included as a feature of IBM MobileFirst™ Platform Foundation, and enables persistent storage of JSON documents. Documents in an application are available in JSONStore even when the device that is running the application is offline. This persistent, always-available storage can be useful for customers, employees, or partners, to give them access to documents when, for example, there is no network connection to the device.

For JSONStore API reference information for Cordova applications, see WL.JSONStore in the API reference section. Cordova applications are supported for iOS, Android, Windows 10 Universal Windows Platform and Windows 8 Universal.

For JSONStore API reference information for native iOS applications, see the JSONStore Class Reference in the API reference section.

For JSONStore API reference information for native Android applications, see the com.worklight.jsonstore.api Package in the API reference section.

Here is a high-level summary of what JSONStore provides:

A single store can have many collections, and each collection can have many documents. It is also possible to have a MobileFirst application that contains multiple stores. For information, see JSONStore multiple user support.

Figure 1. A basic graphic representation of JSONStore.

A basic graphic representation of JSONStore.

Figure 2. Components and their interaction with the server when we use JSONStore for data synchronization.

Components and their interaction with the server when we use JSONStore for data synchronization.

Note: Because it is familiar to developers, relational database terminology is used in this documentation at times to help explain JSONStore. There are many differences between a relational database and JSONStore however. For example, the strict schema used to store data in relational databases is different from JSONStore's approach. With JSONStore, we can store any JSON content, and index the content that you need to search.


Features table

Compare JSONStore features to those features of other data storage technologies and formats.

JSONStore is a JavaScript API for storing data inside Cordova applications that use the MobileFirst plug-in, an Objective-C API for native iOS applications, and a Java™ API for native Android applications. For reference, here is a comparison of different JavaScript storage technologies to see how JSONStore compares to them.

JSONStore is similar to technologies such as LocalStorage, Indexed DB, Cordova Storage API, and Cordova File API. The table shows how some features that are provided by JSONStore compare with other technologies. The JSONStore feature is only available on iOS and Android devices and simulators.

Table 1. A comparison of data storage technologies.
  JSONStore LocalStorage IndexedDB Cordova Storage Cordova File
Android Support (Cordova & Native Applications)
iOS Support (Cordova & Native Applications)
Windows 10 Universal Windows Platform and Windows 8 Universal (Cordova Applications) -
Data encryption - - - -
Maximum Storage Available Space ~5 MB >5 MB Available Space Available Space
Reliable Storage (See Note 2) - -
Keep Track of Local Changes - - - -
Multi-user support - - - -
Indexing - -
Type of Storage JSON Documents Key/Value Pairs JSON Documents Relational (SQL) Strings

Note: 2. Reliable Storage means that your data is not deleted unless one of the following events occurs:

Parent topic: JSONStore