Skip to content

Latest commit

 

History

History
115 lines (87 loc) · 2.42 KB

database.adoc

File metadata and controls

115 lines (87 loc) · 2.42 KB

Compute Platform Database

This library/platform requires a companion PostgreSQL database that will be used for tracking managed jobs.

The schema of the database is configured and maintained by the library itself, thus the library requires credentials for a user that has permission to create, modify, and delete schemata and tables under the target database.

It is recommended that the database not be shared with or used for other purposes.

The database load generated by this library is quite light, so there should be no issue sharing a PostgreSQL instance with other databases.

Permissions

The user the platform uses to connect to the configured database should have effectively all permissions on the target database.

CREATE DATABASE my_database;

CREATE USER my_db_user WITH LOGIN PASSWORD 'somesecretpassword';

GRANT ALL ON DATABASE my_database TO my_db_user;

Schemata

As of version 1 of the platform, all tables managed by the platform will exist under the schema compute.

compute.meta

The compute.meta table holds key/value pairs and is meant to be used solely for storing data relevant to the maintenance of the service, or service internals unrelated to jobs.

Column Type Constraints Purpose

key

VARCHAR(32)

PRIMARY KEY
LEN() > 2

Key/value pair key name.

value

VARCHAR(256)

NOT NULL

Key/value pair value.

compute.jobs

Column Type Constraints Purpose

job_id

BYTEA

PRIMARY KEY
LEN() == 16

Hash ID of the job.

status

VARCHAR(11)

NOT NULL
IN ('queued', 'in-progress', 'complete', 'failed', 'expired')

Current job status.

queue

VARCHAR(32)

NOT NULL

ID/name of the queue the job was submitted to.

config

TEXT (CLOB)

Serialized configuration for the job.

input_files

VARCHAR[]

NOT NULL

Array of the names of files that were included with the job.

created

TIMESTAMP WITH TIME ZONE

NOT NULL

Timestamp for when the job was originally created and queued.

last_accessed

TIMESTAMP WITH TIME ZONE

NOT NULL

Timestamp for when the job was last accessed.

grabbed

TIMESTAMP WITH TIME ZONE

Timestamp for when the job was pulled from the queue to be run.

finished

TIMESTAMP WITH TIME ZONE

Timestamp for when the job was finished (successfully or not)

output_files

VARCHAR[]

Array of the names of files that were created by the job.