Skip to content

Database description#

All the data of the timestamp type is stored in the RFC 3339 format.

The time used for storing data in the database can be set in the configuration file for each service in the "STORAGE_TIME" parameter. You can select "LOCAL" or "UTC" storage time.

When the "STORAGE_TIME" is set to "LOCAL" but you receive time in "UTC", data is converted to local time. When "UTC" is set but the received time is local it is also converted to "UTC".

Faces database description#

This section describes the Faces database fields.

For more information, see "Faces service".

Faces database schema
Faces database schema

Attribute table model#

The database table model describes face attributes linked to faces.

Name

Type

Description

face_id

varchar(36)

Face ID.

gender

integer

Result of gender estimation based on face image:

  • "0" — Male
  • "1" — Female

gender_obtaining_method

integer

Algorithm used to estimate gender based on face image.

gender_version

integer

Version of the algorithm for estimating gender based on face image.

age

integer

Result of age estimation based on face image.

age_obtaining_method

integer

Algorithm used to estimate age based on face image.

age_version

integer

Version of the algorithm for estimating age based on face image.

ethnicity

integer

Result of ethnicity estimation.

ethnicity_obtaining_method

integer

Version of the algorithm for estimating ethnicity.

ethnicity_version

integer

Version of the algorithm for estimating ethnicity.

create_time

timestamp

Attribute creation date and time.

account_id

varchar(36)

Account ID to which the attribute belongs.

descriptor_samples_generation

integer

Generation of the samples used. This value changes when the attribute sample is updated. The initial value is 0.

Descriptor table model#

The database table model describes descriptors.

Name

Type

Description

attribute_id

varchar(36)

Attribute ID.

descriptor_version

integer

Version of NN that was used to extract the descriptor.

descriptor

bytea

Binary descriptor.

descriptor_obtaining_method

integer

Algorithm that was used to obtain the descriptor.

descriptor_generation

integer

Generation of the descriptor. This value changes when the attribute descriptor is updated. It shows that the descriptor does not match existing samples. The initial value is 0.

Face table model#

The database table model describes existing faces.

Name

Type

Description

face_id

varchar(36)

Face ID.

account_id

varchar(36)

Account ID to which the face belongs.

event_id

varchar(36)

Event ID. A reference to the event that created the face.

user_data

varchar(128)

User-defined data for the face.

create_time

timestamp

Time and date of the face creation.

last_update_time

timestamp

Time and date of the last face update.

external_id

varchar(36)

External ID.

External ID is specified in the create face request or in the event creation request ("face_policy").

avatar

varchar(256)

URL of a photo image that corresponds to the face.

List table model#

The database table model describes existing lists.

Name Type Description
list_id varchar(36) List ID.
account_id varchar(36) Account ID to which the list belongs.
user_data varchar(128) User data for the list.
create_time timestamp Time and date when the list was created.
last_update_time timestamp Time and date of the last list update.

List_face table model#

The database table model describes the history of attaching faces to lists. If a face was attached to a list a new record appears.

Name Type Description
list_id varchar(36) List ID.
face_id varchar(36) Face ID.
last_update_time timestamp Date and time of the last linking of the face to the list.
link_key integer Sequence number of linking the face to the list.

The database table model describes the history of detaching faces from lists. If a face was detached from a list, a new record appears.

Name Type Description
unlink_key integer Sequence number of the face and the list unlinking.
list_id varchar(36) List ID.
face_id varchar(36) Face ID.
link_key integer Sequence number of linking of the face and the list.
update_time timestamp Date and time of the last detach of the face from the kist.

Sample table model#

The database table model describes links between samples and faces.

Name

Type

Description

sample_id

varchar(36)

Sample.

face_id

varchar(36)

Face ID related to the sample.

type

integer

Method of using the sample:

  • "1" — To extract descriptor.
  • "5" — To create basic attributes.

The database table model describes the history of deleting lists. If the list has been deleted, a new entry appears.

Name Type Description
list_id varchar(36) List ID.
account_id varchar(36) Account ID to which the list was attached.
deletion_time timestamp Date and time when the list was deleted.
create_time timestamp Date and time when the list was created.
deletion_id integer Deletion ID.

Requests_cache table model#

The database table model describes the cache of the maximum number of faces with associated descriptors or basic attributes for license requests.

Name Type Description
created_at timestamp Date and time of data caching.
value text Encrypted value cache.
name varchar(36) Unique cache name.

Luna-faces_migrations table model#

Name Type Description
version_num varchar(32) Parameter required for database migration.

Events database description#

This section describes the fields in the Events database.

For more information, see "Events service".

Events database schema
Events database schema

Event table model#

The database table model describes existing events. It includes information about created events and faces.

Name

Type

Description

id

bigint

Primary key of the table (digital).

account_id

uuid

Account ID to which the event belongs.

create_time

timestamp

Time code of the event occurrence in the video stream. The parameter is used for the real-time monitoring of events creation.

event_id

uuid

Event ID.

handler_id

uuid

Handler ID that created the event.

source

varchar(128)

Event source. The source is specified in the request for event creation.

face_id

uuid

Face ID of the face corresponding to the event.

gender

smallint

Result of gender estimation based on face image.

age

smallint

Result of age estimation based on face image.

emotion

smallint

Result of emotions estimation.

ethnic_group

smallint

Result of ethnic group estimation.

user_data

varchar(128)

User data for the face corresponding to the event. User data is specified in the request for event creation.

external_id

varchar(36)

External ID of the face corresponding to the event. External ID is specified in the request for event creation.

insert_time

timestamp

Date and time of the event creation.

top_matching_candidates_label

varchar(36)

Label of the group of the candidates used for matching.

top_similar_object_id

uuid

ID of the top similar object from matching results. Matching results are received when the "match_policy" of a handler is enabled.

top_similar_object_similarity

double precision

Similarity score of the top similar object from matching results. Matching results are received when the "match_policy" of a handler is enabled.

top_similar_object_type

smallint

Type of the top similar object:

  • "0" — Face
  • "1" — Event

mask

smallint

Result of medical mask estimation:

  • "1" — Missing
  • "2" — Medical mask
  • "3" — Occluded

track_id

varchar(36)

Track ID. The ID can be specified in the event generation request.

liveness

smallint

Result of Liveness check:

  • "0" — Spoof
  • "1" — Real
  • "2" — Unknown

end_time

timestamp

End time code of the event occurrence in the video stream. The parameter is used for the real-time monitoring of events creation. Set equal to "create_time" if not set.

top_similar_external_id

varchar(36)

External ID of the top similar object from matching results. Matching results are received when the "match_policy" of a handler is enabled.

apparent_age

smallint

Result of age estimation based on body image.

apparent_gender

smallint

Result of gender estimation based on body image:

  • "0" — Female
  • "1" — Male
  • "2" — Unknown

backpack_state

smallint

Result of backpack state estimation:

  • "0" — Absent
  • "1" — Present
  • "2" — Unknown

headwear_state

smallint

Result of headwear state estimation:

  • "0" — Absent
  • "1" — Present
  • "2" — Unknown

sleeve_length

smallint

Result of sleeve length estimation:

  • "0" — Short
  • "1" — Long
  • "2" — Undefined

upper_clothing_color

array[int]

Result of upper clothing color estimation:

  • "0" — Unknown
  • "1" — Black
  • "2" — Blue
  • "3" — Green
  • "4" — Gray
  • "5" — Orange
  • "6" — Purple
  • "7" — Red
  • "8" — White
  • "9" — Yellow
  • "10" — Pink
  • "11" — Brown
  • "12" — Beige
  • "13" — Khaki
  • "14" — Multicolored

headwear_apparent_color

smallint

Result of headwear apparent color estimation:

  • "0" — Unknown
  • "1" — White
  • "2" — Black
  • "3" — Other

lower_garment_type

smallint

Result of lower garment type estimation:

  • "0" — Unknown
  • "1" — Trousers
  • "2" — Shorts
  • "3" — Skirt

lower_garment_colors

array[int]

Result of lower garment colors estimation:

  • "0" — Unknown
  • "1" — Black
  • "2" — Blue
  • "3" — Green
  • "4" — Gray
  • "5" — Orange
  • "6" — Purple
  • "7" — Red
  • "8" — White
  • "9" — Yellow
  • "10" — Pink
  • "11" — Brown
  • "12" — Beige
  • "13" — Khaki
  • "14" — Multicolored

shoes_apparent_color

smallint

Result of shoes apparent color estimation:

  • "0" — Unknown
  • "1" — White
  • "2" — Black
  • "3" — Other

meta

jsonb

User meta-information.

deepfake

smallint

Result of Deepfake estimation:

  • "0" — Spoof
  • "1" — Real

Face_detect_result table model#

The database table model describes face detection.

Name Type Description
id bigint Primary key of the table (digital).
numeric_id integer Foreign key of an event.
rect_x smallint Top left corner coordinate of the face bounding rectangle by the "X" axis.
rect_y smallint Top left corner coordinate of the face bounding rectangle by the "Y" axis.
rect_w smallint Width of the face bounding rectangle.
rect_h smallint Height of the face bounding rectangle.
sample_id varchar(36) Sample ID.
detect_time timestamp Time of the face detection.
image_origin varchar(256) URL to the source image where the face has occurred.
detect_ts interval Time relative to something, such as relative to the beginning of a video file.

Body_detect_result table model#

The database table model describes face detection.

Name Type Description
id bigint Primary key of the table (digital).
numeric_id integer Foreign key of an event.
rect_x smallint Top left corner coordinate of the body bounding rectangle by the "X" axis.
rect_y smallint Top left corner coordinate of the body bounding rectangle by the "Y" axis.
rect_w smallint Width of the body bounding rectangle.
rect_h smallint Height of the body bounding rectangle.
sample_id varchar(36) Sample ID.
detect_time timestamp Time of the body detection.
image_origin varchar(256) URL to the source image where the body has occurred.
detect_ts interval Time relative to something, such as relative to the beginning of a video file.

Face_descriptor table model#

The database table model describes face descriptors stored in the database.

Name Type Description
id bigint Primary key of the table (digital).
numeric_id bigint Foreign key of the event.
descriptor bytea Binary face descriptor.
descriptor_version integer The version of NN that was used to extract the descriptor.

Body_descriptor table model#

The database table model describes body descriptors stored in the database.

Name Type Description
id bigint Primary key of the table (digital).
numeric_id bigint Foreign key of the event.
descriptor bytea Binary body descriptor.
descriptor_version integer The version of NN that was used to extract the descriptor.

Event_match_result table model#

The database table model describes matching results received using the matching policy of handler. Each record includes information about an event used for matching and the estimated similarity.

Name Type Description
id bigint Primary key of the table (digital).
numeric_id bigint Foreign key of the event.
label varchar(36) The label specified for the matching results.
similarity double precision The similarity score received after matching of the event descriptor with the given descriptor.
event_id uuid Event ID.
user_data varchar(128) User data associated with the event.
create_time timestamp Event creation time.
external_id varchar(36) External ID of the face created during event creation.
handler_id uuid ID used for the event creation .
source varchar(128) Event source.

Face_match_result table model#

The database table model describes matching results received using the matching policy of handler. Each record includes information about the face used for matching and the estimated similarity.

Name Type Description
id bigint Primary key of the table (digital).
numeric_id bigint Foreign key of the event.
label varchar(36) The label specified for the matching results.
similarity double precision The similarity score received after matching of the event descriptor with the given face descriptor.
face_id uuid Face ID.
user_data varchar(128) User data associated with the face.
create_time timestamp Face creation time.
external_id varchar(36) External ID of the face.

Location table model#

Name Type Description
id bigint Primary key of the table (digital).
numeric_id bigint Foreign key of the event.
city varchar(36) The city of event occurrence.
area varchar(36) The area of event occurrence.
district varchar(36) The district of event occurrence.
street varchar(128) The street of event occurrence.
house_number varchar(36) The house number where the event occurred.
geo_position geography Geographical coordinate of the event occurrence (longitude, latitude).

Tag table model#

The database table model describes tags for events. Tags are specified in an event creation request.

Name Type Description
id bigint Primary key of the table (digital).
numeric_id integer Foreign key of an event.
tag varchar(36) Event tag.

Attach_result table model#

The database table model describes the attachment of the face created from an event to a list. The face is created using "face_policy". The face is attached to a list using "link_to_lists_policy".

Name Type Description
id bigint Primary key of the table (digital).
numeric_id integer Foreign key of an event.
list_id uuid List to which the created face was attached.

Tasks database#

This section describes the fields in the Tasks database.

For more information, see "Tasks service".

Tasks database schema
Tasks database schema

Task table model#

The database table model describes the created tasks. It includes general information about a task and its content.

Name

Type

Description

task_id

integer

Task ID.

create_time

timestamp

Task creation time.

end_time

timestamp

Task end time.

last_update_time

timestamp

Task last update time.

task_type

integer

Task type:

  • "0" — Unknown
  • "1" — Linker
  • "2" — Clustering
  • "3" — Reporter
  • "4" — Garbage collection
  • "5" — Additional extraction
  • "6" — Cross-matching
  • "7" — ROC-curve calculating
  • "8" — Exporter
  • "9" — Estimator

task_status

integer

Task status:

  • "0" — Pending
  • "1" — In progress
  • "2" — Cancelled
  • "3" — Failed
  • "4" — Collect results
  • "5" — Done

result_id

varchar(36)

Task result ID.

account_id

varchar(36)

Account ID to which the task belongs.

count_task_parts_done

integer

Number of finished subtasks.

count_task_parts_all

integer

Total number of subtasks.

content

text

Filters and request parameters for the task.

description

varchar(128)

User-defined task description.

schedule_id

integer

Schedule ID.

Subtask table model#

The database table model includes information about created subtasks. Depending on a task type there may be one or several subtasks.

Name

Type

Description

subtask_id

integer

Subtask ID.

task_id

integer

ID of the corresponding task.

result_id

varchar(36)

ID of the subtask result.

create_time

timestamp

Subtask creation time.

end_time

timestamp

Subtask end time.

subtask_status

integer

Subtask status:

  • "0" — Pending
  • "1" — In progress
  • "2" — Cancelled
  • "3" — Failed
  • "4" — Collect results
  • "5" — Done

content

text

Filters and request parameters for a subtask processing.

Task_error table model#

The database table model includes information about errors occurred during task processing. Errors are added to the table by Tasks workers.

Name Type Description
error_id integer Task error ID.
task_id integer ID of the corresponding task.
error_code integer Error code.
description varchar(64) Error short description.
detail varchar(1024) Detailed description of the error.
additional_info varchar(128) Additional information about the error. It may include lost object IDs or any other useful information.
error_time timestamp Time when the error occurred.

Schedule table model#

The database table model includes information about the task execution schedule.

Name

Type

Description

schedule_id

integer

Schedule ID.

create_time

timestamp

Date the schedule was created.

last_update_time

timestamp

Date and time of the last schedule changes.

status

smallint

Schedule status:

  • "1" — Started
  • "2" — Stopped

trigger

varchar(128)

Cron expression.

trigger_timezone

varchar(16)

Time zone (UTC or LOCAL).

account_id

varchar(36)

Account ID that the schedule belongs to.

task_type

integer

Type of task that runs on a schedule.

content

text

Content of the scheduled task (filters, list, etc.)

next_run_at

timestamp

Time of the next task start.

Luna-tasks_migrations table model#

Name Type Description
version_num varchar(32) Parameter required for database migration.

Handlers database#

This section describes the fields in the Handlers database.

For more information about the Handlers service, see "Handlers service".

Handlers database schema
Handlers database schema

Handler table model#

Name

Type

Description

handler_id

varchar(36)

UUID4 standard handler ID in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.

account_id

varchar(36)

Account ID in UUID4 format that the handler belongs to.

create_time

timestamp

Date and time of handler creation.

last_update_time

timestamp

Date and time of last change of the handler.

description

varchar(128)

Handler description provided by the user.

handler_type

smallint

Handler type:

  • "0" — Static
  • "1" — Dynamic
  • "2" — Lambda

lambda_id

smallint

Lambda ID.

policies

varchar(36)

Handler policies.

Verifier table model#

Name Type Description
account_id varchar Account ID in UUID4 format that the verifier belongs to.
create_time timestamp Date and time of verifier creation.
description varchar Verifier description provided by the user.
verifier_id varchar(36) UUID4 standard verifier ID in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
last_update_time timestamp Date and time of the latest handler modification.
policies varchar(2048) Verifier policies.
version integer Verifier version.

Luna-handlers_migrations table model#

Name Type Description
version_num varchar(32) Parameter required for database migration.

Configurator database#

This section describes the fields of the Configurator database.

For more information, see "Configurator service".

Configurator database schema
Configurator database schema

Limitation table model#

Name Type Description
limitation_name varchar(128) Name of the limitation.
validation_schema varchar Limitation validation schema.
services varchar List of services.
default_value varchar Default limitation value.
description varchar(128) Limitation description.

Settings table model#

Name Type Description
id integer Setting ID.
value varchar Setting value.
description varchar(128) Settings description.
create_time timestamp Setting creation time.
last_update_time timestamp Latest time of setting modification.
name varchar(128) Setting name.
is_default boolean Whether the setting is default.

Tag table model#

Name Type Description
id integer Setting ID.
name varchar(128) Setting name.
tag varchar(128) Setting tag string.

Group table model#

Name Type Description
group_name varchar(128) Group name.
description varchar(256) Group description.

Group_limitation table model#

Name Type Description
group_name varchar(128) Group name.
limitation_name varchar(128) Limitation name.

Configs_migration table model#

Name Type Description
revision varchar(36) Revision of settings migration.

Luna-conf_migrations table model#

Name Type Description
version_num varchar(32) Parameter required for database migration.

Backport3 database#

This section describes the fields of the Backport 3 database.

For more information, see "Backport 3 service".

Backport3 database schema
Backport3 database schema

Account table model#

Database table model for account.

Name Type Description
account_id varchar(36) UUID4 standard account ID.
active boolean Account status.

Account_token model table#

Name Type Description
token_id varchar(36) Token ID.
account_id varchar(36) Account ID, the token is linked to.
token_info varchar(128) A string with token data.

Person table model#

Name Type Description
person_id varchar(36) UUID4 standard person ID, in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
account_id varchar(36) UUID4 standard ID of the account to which the person belongs, "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
user_data varchar(128) Person user data.
create_time timestamp Date and time of person creation.
external_id varchar(36) Person ID in external system.

Persons_list table model#

Name Type Description
list_id varchar(36) UUID4 standard list ID in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
account_id varchar(36) UUID4 standard account ID, in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
create_time timestamp Date and time of list creation.

Descriptors_list table model#

Name Type Description
list_id varchar(36) UUID4 standard list ID in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
account_id varchar(36) UUID4 standard account ID, the list belongs to, in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
create_time timestamp Date and time of list creation.

List_person table model#

Name Type Description
list_id varchar(36) UUID4 standard list ID in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
person_id varchar(36) UUID4 standard person ID, in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.

Person_face table model#

Name Type Description
person_id varchar(36) UUID4 standard person ID, in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
face_id varchar(36) UUID4 standard face ID, in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.

Luna-backport3_migrations table model#

Name Type Description
version_num varchar(32) Parameter required for database migration.

Handler table model#

Name Type Description
account_id varchar(36) UUID4 standard account ID, the handler belongs to, in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
type integer Handler type.
handler_id varchar(36) UUID4 standard handler ID in "xxxxxxxx-xxxx-4xxx-{8-9}xx-xxxxxxxxxxxx" format.
create_time timestamp Date and time of handler creation.
last_update_time timestamp Date and time of the latest handler modification.
policies varchar(2048) handler policies.
version integer Handler version.

Accounts database#

This section describes the fields in the Accounts database.

For more information, see "Accounts service".

Accounts database schema
Accounts database schema

Account table model#

Name

Type

Description

account_id

varchar(36)

Account ID in UUID4 format.

login

varchar(128)

Account login.

password

varchar(128)

Account password.

description

varchar(128)

Account description.

account_type

varchar(16)

Account type:

  • "user"
  • "advanced_user"
  • "admin"

create_time

timestamp

Date and time of account creation.

last_update_time

timestamp

Date and time of the latest account modification.

Token table model#

Name

Type

Description

token_id

varchar(36)

Token ID in UUID4 format.

permissions

varchar(128)

Token permissions.

expiration_time

varchar(128)

Token expiration time.

description

varchar(128)

Token description.

visibility_area

varchar(128)

Token visibility area:

  • "all"
  • "account"

account_id

varchar(16)

Account ID in UUID4 format to which the token is linked.

Luna-accounts_migration table model#

Name Type Description
version_num varchar(32) Parameter required for database migration.

Lambda database#

This section describes the fields of the Lambda database.

For more information, see "Lambda service".

Lambda DB schema
Lambda DB schema

Lambda table model#

Name

Type

Description

name

varchar(36)

Lambda name.

description

varchar(256)

Lambda description.

version

integer

Lambda version.

account_id

varchar(16)

Account ID in UUID4 format to which the lambda is linked.

status

smallint

Lambda creation status:

  • "running"
  • "waiting"
  • "terminated"
  • "not_found"

create_time

timestamp

Lambda creation time.

last_update_time

timestamp

Lambda last updated date and time.

user_commands

varchar

List of additional Docker commands for creating a lambda container.

lambda_type

varchar(10)

Lambda type:

  • "handlers"
  • "standalone"

id

varchar(36)

Lambda ID.

Luna-lambda_migration table model#

Name Type Description
version_num varchar(32) Parameter required for database migration.