Skip to main content

Concepts

Abacus is an Object Event Database: it records things and what happened to them, for any domain. Its Schema looks like Postgres: an Object is a table, an Attribute is a column, and an Object Event is a row.

Objects​

An Object is a table. It has an Id, a Label and up to 31 Attributes.

Attributes​

An Attribute is a column of one Object. It has an Id, a Label and one Scalar Type. CopyAttributes copies Attributes to other Objects.

An Object that models a person might have these Attributes:

IdScalar Type
FirstNameString
LastNameString
AgeInt

Scalar Types​

A Scalar Type is the kind of value an Attribute holds. Abacus has ten:

Scalar TypePostgres column type
Intint
Floatfloat
Numericnumeric
Booleanbool
Stringsee below
Jsonsee below
DateTimetimestamptz
DateTimeZonetext
DateIntervalinterval
UuidV7uuid

A String or Json value is stored once, in a table shared by every Object, and its column holds a number that points to it. A query reads the value itself.

Object Events​

An Object Event is a row of an Object: what one thing looked like at one moment. CreateObjectEvents writes them.

An Object Event may carry any of its Object's Attributes; the rest are empty. Abacus stores each as it is given.

FirstName (String)LastName (String)Age (Int)
FIRST_NAMELAST_NAME30
FIRST_NAMELAST_NAME31
FIRST_NAMENEW_LAST_NAME32

Aliases​

An Alias is a name a value can carry, so a query can match the value by that name. Only an Int, String or Json value can carry Aliases, and one Alias may name many values.

For example, a Jira status can be stored as its status id, an Int, carrying its status name as an Alias. This Where matches every status id named To Do:

Where: { Binary: { Left: { Attribute: { Id: { In: "Questions.StatusHistory.Status" }, ObjectReference: "S" } }, Operator: Equal, Right: { Alias: "To Do" } } }

An Alias can only be compared with Equal to an Attribute; anywhere else it is refused.

Selecting Object Events​

SelectObjectEvents reads Object Events with a query shaped like a Postgres SELECT: Select, Distinct, From, Where, GroupBy, Having, Order and Limit, where From names Objects as tables. It answers with Columns, the name of each column, and Rows, where each row lists its values in the same order as Columns.

ExplainSelectObjectEvents takes the same query and answers with the plan Postgres would follow.