Database overview
IBM® Cloudant® for IBM Cloud® databases contain JSON objects. These JSON objects are called documents.
All documents must be contained in a database. For more information, see partitioned databases.
The Grouping related documents together in IBM Cloudant guide provides an example of how documents for an e-commerce application might be used within an IBM Cloudant database.
Partitioned databases
IBM Cloudant supports two types of databases:
- Partitioned
- Nonpartitioned
A partitioned database offers significant query performance and cost advantages but requires you to specify a logical partitioning of your data. The partitioning is specified as part of each document's ID. A partitioned database provides both global and partition queries. Partition queries target queries at a single, given document partition, meaning they need to process less data to return results. Therefore, partition queries offer significant performance advantages, and also often provide cost advantages over global queries. Global queries target the entire database, which leads to extra complexity, slower performance, and increased cost, but offers results that draw from all data.
Alternatively, a nonpartitioned database might be created. This type of database can be less complex to work with since no partitioning scheme needs to be defined, but you can create only global secondary indexes.
IBM Cloudant strongly encourages you to use a partitioned database for best long-term database performance where the data model allows for logical partitioning of documents.
The partitioning type of a database is set at database creation time. When you create a database, use the partitioned
query string parameter to set whether the database is partitioned. The default for partitioned
is
false
, maintaining compatibility with an earlier version.
The partitioning type can't be changed for an existing database.
For more information, see Database partitioning.