Connecting to storage (storage)

Table of Contents

Description

Defines the access parameters for a specific storage to be used by the platform.
Specifies the type. Data can be located in postgresql, kafka, clickhouse clusters. Files - in s3, fs, nfs, fsync.
Sets the code (instance) and allows it to be referenced when customizing data model classes.
An element with instance = auto is created automatically.

Fields

Entity structure
{
  "id": uuid,
  "name": str,
  "instance": str,
  "params": object,
  "opts": {
    "title": str,
    "comment": str
  },
  "ext": {
    "ct": date,
    "lwt": date
  }
}
Table 1. Fields
Specification Description

Field: id
Mode: inout
Type: uuid
Default: generated

Identifier. Can be specified at creation, otherwise generated by the system.

Field: type
Mode: in
Type: str
Default: required

Code. Used to associate with other entities.

  • postgresql. Instance of the postgresql relational database. Multiple instances with the same instance value are considered replicas of each other.

  • kafka. Kafka Cluster. One entity defines several cluster brokers at once.

  • clickhouse. Clickhouse analytic columnar database cluster server. Multiple instances with the same instance value are considered servers of the same cluster.

  • s3. S3 File Storage. Can be used both as a data model server (dms) and for storing call recordings.

  • nfs. File storage on a network disk accessible from any node as a folder on the current server.

  • fs. A file store organized on multiple servers that hosts instances of the file server role (or middleware in its absence).

  • fsync. File storage in the synchronized folder. Synchronization takes place within 10 seconds to all servers of the site and other sites where the domain is served.

Field: instance
Mode: in
Type: str
Default: required

Storage Name. Used when binding to classes.

Stores with the value auto are generated and applied automatically if they are not explicitly present in the collection.
Data is placed in storages with type postgresql (for tabular data) and fs (for attachment files).

Field: params
Mode: in
Type: object
Default: required

Storage-specific parameters.

  • For postgresql: 'host', 'port', 'login', 'pwd', 'database', (optionally 'max_connections' - default is 10, which applies separately for user calls and for calls from the system and from under tokens).

  • For kafka: 'endpoints'. Each endpoint contains 'host', 'port'. (optional 'send_mode' - mode of sending messages to the KAFKA broker ('sync' or 'async', default is 'sync'), 'partition_count' - number of partitions for the topic (default is taken from class), 'replication_factor' - number of replications for the topic (default is taken from class), 'replication_factor' - number of replications for the topic (default is taken from class) ).

  • For clickhouse: 'cluster', 'host', 'login', 'password', 'port'.

  • For s3: 'bucket', 'keyId', 'secretKey', (optional) 'region', 'endpoint', 'prefix').

  • For nfs: 'configkey', 'prefix'. configkey: 'globalshare', 'siteshare', 'local'.

  • For fs: 'prefix'

  • For fsync: 'prefix'.

Field: opts
Mode: in
Type: object
Composite field

Field: opts.title
Mode: in
Type: str
Default: empty

Arbitrary header

Field: opts.comment
Mode: in
Type: empty
Default: "

Arbitrary comment

Field: ext
Mode: inout
Type: object
Compound field

Allows you to extend the compound with arbitrary keys and values

Field: ext.ct
Mode: out
Type: date
Default: generated

Object creation time

Field: ext.lwt
Mode: out
Type: date
Default: generated

Time of last modification of the object