Skip to main content

Welcome to InterSystems IRIS Cloud Document Service!

With the InterSystems IRIS® Cloud Document Service, you can store data in a flexible document database with full cloud support and query it using a familiar SQL syntax.

To query data stored in a relational database, try InterSystems IRIS Cloud SQL.

Using InterSystems IRIS Cloud Document

To get started with InterSystems IRIS Cloud Document Service, load the InterSystems Cloud Services PortalOpens in a new tab to sign up for a trial or subscription. Follow the instructions to create a deployment.

After creating a deployment, add at least one file containing an array of JSON objects to the deployment on the Add and Manage Files page. Then, navigate to the Collection Import page to import the array of JSON objects from the file into a collection. Once you have created a collection, use the JSON_TABLEOpens in a new tab SQL function to create a relational table that represents the data in your documents. This relational table can then be easily queried like any other SQL table. Additionally, you can define indexes to improve the efficiency of JSON_TABLE.

If you have enabled external connections, you can connect your deployment to a Java or .NET application by:

Once connected, your application can access the data stored in documents hosted in your deployment of the Cloud Document Service. The sections below link to more comprehensive documentation for using the Java and .NET drivers with the Cloud Document Service.

Using Document Database with JavaOpens in a new tab Using Document Database with .NETOpens in a new tab

Note that you can only use read-only SQL commands, like SELECT, through the Portal interface. To write or delete data, enable external connections, connect your deployment to an application with a database driver, and execute the desired command from your application.

Indexes on Collections

A collection is a set of similarly structured documents that often queried together. They are analogous to a table schema in a relational database, but are not prescriptive. As a result, documents in a collection do not need to have the exact same set of fields, offering flexibility amongst the contents in the database. Some entries in the collection may contain data in a particular field that does not exist in other entries, without the need to maintain null or empty values. Nonetheless, a collection should contain relatively similar data to take advantage of indexes on common fields.

Creating an index on a field can greatly improve the efficiency of operations issued against the collection, particularly JSON_TABLE. When you create an index on a particular field, documents with the same value for that field are grouped together. Similar to an index on a relational table, an index on a collection reduces the number of documents that a query needs to read when searching for data with a particular value in the field.

To create, delete, or build an index, navigate to the Create Indices page in the Portal. To create an index, select the collection you would like to create the index on, then click the Create Index button. Fill out the form to create the index.

Once you have created an index, you can select it in the Defined Indices list and use the Build Index and Delete Index to build and delete the index, respectively.

Index Options for Collections

You can create three different types of indexes: map, bitmap, and key. The difference between these types are explained below.

Map Index

Each entry in the index contains a key, derived from the field that the index is built on, and points to the documents in the database that share that key. This index is analogous to standard index in Cloud SQL.

Bitmap Index

A bitmap index is similar to a map index, but the pointer to the record is an integer computed using its bit position. In many cases, a bitmap index is more efficient than a map index. This index is analogous to a bitmap index in Cloud SQL.

Key Index

The index key is unique, corresponding with a single document in the database. This index is analogous to defining an index on a relational table with the UNIQUEOpens in a new tab constraint in Cloud SQL.

Learning Resources

FeedbackOpens in a new tab