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 hybrid applications, see WL.JSONStore in the API reference section. Hybrid applications are supported for iOS, Android, Windows 8, and Windows 8 Phone.

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 developer-friendly API that gives developers the ability to populate the local store with documents, and to update, delete, and search across documents.
  • Persistent, file-based storage matches the scope of the application.
  • AES 256 encryption of stored data provides security and confidentiality. You can segment protection by user with password-protection, in the case of more than one user on a single device.
  • Ability to keep track of local changes.
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 you use JSONStore for data synchronization.
Components and their interaction with the server when you 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 that is used to store data in relational databases is different from JSONStore's approach. With JSONStore, you 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 hybrid MobileFirst applications, 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, Cordova File API, and MobileFirst Encrypted Cache. 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 Encrypted Cache LocalStorage IndexedDB Cordova Storage Cordova File
Android Support (Hyrbid & Native Applications)
iOS Support (Hybrid & Native Applications)
Windows 8 and Windows 8 Phone Support -
Web Dev Only (See Note 1) - -
Data encryption - - - -
Maximum Storage Available Space ~5 MB ~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 Key/Value Pairs JSON Documents Relational (SQL) Strings
Note: 1. Dev Only means designed only for development, with no security features and a ~5 MB storage space limit.
Note: 2. Reliable Storage means that your data is not deleted unless one of the following events occurs:
  • The application is removed from the device.
  • One of the methods that removes data is called.