Skip to main content

Collections

A collection is a group of documents with a unique name and identifier. These collections can be empty or contain documents. Macrometa GDN is schemaless, hence removing the need to define a structure when storing valid document attributes. Documents with completely different structures can be stored in the same collection.

Local and Global Collections

GDN allows you to create local or global collections.

  • A local collection stores its data in one region and does not replicate to other regions in the fabric. You can create a local collection in any specified region. A best practice is to use a region-specific API endpoint when interacting with local collections. Thus, if a user sends a request to a local collection without being routed to the appropriate region, the request will fail.
  • A global collection replicates its data and maintains state and consistency across all regions in the fabric.

Types of Collections

Macrometa offers several types of collections.

  • Document collection: NoSQL database that stores data in JSON format (JavaScript Object Notation). These databases are helpful for storing diverse forms of data, and are thus useful for building content management applications and e-commerce applications.
  • Key-Value collection: Contains documents in which each document stored in a collection contains a _key, and the rest of the document is its value. Key-Value Databases are a type of noSQL database that stores different kinds of information, offering more flexibility and ease of retrieval.
  • Redis Mode: This type allows you to use Macrometa with the Redis API and perform different operations with the Redis client.
  • Dynamo Table: A dynamo table collection allows you to use AWS Dynamo Database with Macrometa as a datastore.
  • Graph Edge collection: This type stores edge documents (or edges) that define a relationship between other documents with the _from and _to values. A vertex is a document collection that contains graphs. Graph databases are also a kind of noSQL database that establishes relationships between entities.