-
Notifications
You must be signed in to change notification settings - Fork 1
NoSQL Local Database API
The Predix SDK for IOS Database API utilizes a Document Store type of "NoSQL" or non-relational database. The central concept of this type of NoSQL database is the "document". The document encapsulates and organizes data in name/value pairs; and it is identified by a system-wide unique identifer.
At a document's top level, each name/value pair must have a name (a unique string), and a value. The value may be either a simple type like a string, integer, boolean, etc; or a complex type such as an array or another name/value pair dictionary. Documents are encoded into a JSON format, so only JSON-compatible types are allowed in documents.
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, GCD, and Swift closures to enable the maximum performance and responsiveness from their PredixSDK-based applications.
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 interation use cases. As with any offline data interaction, care must be taken to determine what type of data a user needs when offline. It is important when designing your applications data model 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. When designing your applications data model, it is critical 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.
The PredixSDK Database has the capability to create indexes of the documents its Document Store, and then run queries against those indexes. This can enable searches, 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 key, and queries can retrieve data from the index by either specifying a list of keys, or a range of keys. These keys can be simple data types, or arrays to provide more complex sorting and retrieval scenarios.
Getting Started Guides
Features
How-To Guides:
- Using Authentication API to Authenticate a User
- Using Online API to make Network Requests
- Using Time Serires API to Fetch Time Series Data
- Disable Usage Analytic tracking
API Documentation: