Collections

A collection is a table. It is a folder in a domain's datahoster-collections folder, named for the collection. Inside it are a datahoster-collection.json of settings, a folder of typed columns, and, optionally, a folder of records to import from local files.

<datahoster-config-contentRoot>/
  api.example.com/
    datahoster-collections/
      messages/                        the "messages" collection
        datahoster-collection.json
        datahoster-collection-columns/   its columns
        datahoster-collection-import/    records to load into it
      signups/                         the "signups" collection
A domain's collections, one folder each.

Contents

Each domain has a datahoster-collections folder; inside it every collection is a folder, named for the collection. Each collection folder holds its settings file, a columns folder, and an optional import folder.

NameTypeDescription
datahoster-collection.jsonfileThe collection's settings: its name and its storage chunk sizes.
datahoster-collection-columns/directoryThe collection's columns, one JSON file per column.
datahoster-collection-import/directoryOptional. Records to load into the collection on sync, one or more JSON files.

datahoster-collection.json

One JSON object holding the collection's settings. Its keys are fixed names starting with datahoster-collection-, so none of your own names appear in a key.

{
  "datahoster-collection-name": "messages",
  "datahoster-collection-recordsPerChunkFile": 1000000,
  "datahoster-collection-recordsPerTailChunk": 65536,
  "datahoster-collection-maxTextFileSize": 64000000
}
The messages collection's settings.
NameTypeDescription
datahoster-collection-nametextThe collection's name. Must match the folder name. Required.
datahoster-collection-recordsPerChunkFileintegerHow many records the server keeps in one on-disk column-chunk file. Defaults to 1000000.
datahoster-collection-recordsPerTailChunkintegerThe size, in records, of the in-memory tail buffer the store grows by before it fills a chunk. Defaults to 65536.
datahoster-collection-maxTextFileSizeintegerThe size limit, in bytes, of a text column's strings file before the next one starts. Defaults to 64000000.