Storage (st)

Description

Universal site storage. Used by various roles as an internal service.

Made redundant in Active-Passive mode. Scaled by splitting into groups by key hash sums.

Table 1. System characteristics

Code

st

Operation mode

Storage

Redundancy mode

Active-Passive

Site types

All

Layer

Business logic

Placement

Internal

State preservation and recovery on restart

Yes

Application

era_store

Own storage

ODB Mnesia

Limitations

  • Present in the initial configuration.

  • Must be present on every site.

  • If the role is unavailable, most services do not function, including system startup.

Parameters

Table 2. Parameters
Name Type Default Description

name

str

required

Name. May consist of Latin letters and digits and must start with a letter.

roletype

str

required

Role type. Possible values: "st".

ext

json

empty

Additional role options. Contains a JSON object or list.

enabled

bool

empty

Role activity flag. When set to false, the role does not participate in validation and is not started.

limit_of_cores

int

empty

Limit on the number of CPU logical cores used. Default: 0 - unlimited.

logging_default_level

int

empty

Default logging level set specifically for the role instance (microservice type). More

allow_divergence

bool

false

Flag allowing parameter differences in roles of the same group. Default: false - not allowed.

group

int

required

Group number.
As part of horizontal scaling, the role can be split into several groups on a site, in each of which only one instance is active and the rest are standby.
Responsibility is divided between groups by hash sums of stored data keys. All roles in one group must have the same responsibility.
Hash sums are calculated automatically by an internal algorithm with uniform random distribution.
If the peak load on the active instance exceeds the normal level, it is enough to add several more groups and distribute them across different servers; the load is redistributed proportionally.
After changing the composition of groups in the site configuration, all stored data immediately becomes stale because the group binding in the hash ring changes.
An integer from 1 to 9999999.

order

int

required

Order of the role instance within the group.
Determines the order in which takeover occurs in Active-Passive mode.

mnesia_storage_mode

str

disc

Object storage operation mode.
Possible values:

  • disc - full mode, in RAM with disk persistence on all group instances.

  • ram - RAM only (with distributed and transactional support). If all group instances restart or shut down simultaneously, data is lost.

  • disc_only - disk only (noticeably less performant but saves RAM).

takeover

bool

global

Takeover mode switch.

Failover - activation of a lower-priority service instance when the higher-priority service instance (leader of the active-passive group) is detected as unavailable.
Takeover - activation of the higher-priority service instance (leader of the active-passive group) during its recovery, accompanied by stopping the service on the lower-priority service instance.

  • If the mode is enabled, takeover is performed automatically.

  • If the mode is disabled, takeover is not performed; the recovered group leader temporarily becomes a follower and waits for the service to be unloaded on the lower-priority instance.

  • If the option is not set, its value from the current site parameters is used. If it is not set on the site, the value from the general section is used. If it is not set anywhere, takeover is enabled for more accurate load distribution according to the configured priorities.

Configuration example

Configuration management is performed in an application available to master domain administrators. The application hides the full configuration content, but it is still available through the API.

The configuration contains a section describing all instances of all roles. Parameters are defined for each specific role instance.

Node example
{
  "st1": {
    "name": "store1",
    "roletype": "st",

    "group": "11080",
    "order": "1"
  }
}

See also