Skip to content

NoSQL Local Database API

Arpillai edited this page Jan 23, 2018 · 7 revisions

NoSQL Database API

The Predix SDK for IOS NoSQL Local Database API allows you to replicate and load balance your data.

Features

Document Database Management

Document management allowing you to write, retrieve, or delete a document from a database.

The central concept of the NoSQL database is the "document". The document encapsulates and organizes data in name/value pairs; and it is identified by a system-wide unique identifier (ID).

Async Interaction

Async interaction to maximize mobile device resources and UI responsiveness.

The PredixSDK Database API is largely asynchronous in nature. The API calls for most document interactions and running queries takes a Swift completion handler closure as a parameter. The closure is called when the requested operation is complete. This is similar to many other APIs within the Apple ecosystem.

**Note - ** Developers using the PredixSDK must have a thorough understanding of asynchronous patterns, Google Cloud Datastore (GCD), and Swift closures to enable the maximum performance and responsiveness from their PredixSDK-based applications.

Data Replication

Easy set up for data replication and flexibility for many complex data iteration use cases.

You can use the PredixSDK Database as a local data store and use it with the PredixSync service to synchronize documents to and from a backend server and to other users. Data replication is a complex task but the Predix system makes it easy to setup and provides flexibility for many complex data iteration use cases.

**Note - ** As with any offline data interaction, care must be taken to determine what type of data a user needs when offline. When designing your applications data model, it is important to consider that mobile devices have limited storage capacity and often have limited network bandwidth. A balance must be struck between having enough information to meet the applications use cases, and preventing an application from being too "chatty" or attempting to synchronize large quantities of data.

Indexes and Queries

Ability to create indexes of the documents and run queries against those indexes.

With indexes and queries, you can enable searches, perform sorting, summarization, and other more relational database-like data interactions. An index consists of a key (the data being indexed) and an optional value (additional data stored with the index). The data in the index is sorted based on a key. Queries can retrieve data from the index by either specifying a list of keys or a range of keys. These keys are simple data types or arrays to provide more complex sorting and retrieval scenarios.

Next Step:

Read the Getting Started with NoSQL the Local Database Guide