GLUE  | gloo |

1 A programming language designed for enterprise data pools.

2 An acronym for Great Language Unification for Enterprises.

Motivation

  1. Creating a "Single-Point-of-Truth".

  2. Reintegrating the "Shadow-IT".

One of the biggest challenges in today's enterprise IT is the integration of all business related information into one consistent data pool (aka the "Single-Point-of-Truth").

The problem is that people usually do not want to wait until a centrally coordinated data pool integrates their wishes for new features but they rather directly implement new features into local applications outside of the central data pool (aka the "Shadow-IT").

In order to overcome this situation a new programming language is proposed which provides strong capabilities for information centralization.

Main Features

  1. Server-based Language

    The GLUE language is executed on an ACID compliant server (the GLUE Server).

    This allows users and programmers to simultaneously work on a shared code- and database.

  2. Code-Data Identity

    The GLUE language provides a unified interface to code and data.

    This allows the GLUE Server to act as database and as code-repository and thus the server can keep code and data mutually consistent.

  3. Automatic Change-Tracking

    The GLUE Server automatically tracks all changes.

    This means that data models do no longer need to include 'validSince' and 'validUntil' time-stamps (which also means that programmers no longer need to worry about reading and writing from/to these time-stamps).

Examples

  1. Intuitive Data Models
  2. Object Tags
  3. Time Operations
  4. Time-Constant Relations
  5. Units and Dimensions
  6. Convenience Aggregation
  7. Forgery-Proof Versioning System
  8. Full Audit Compliance
1.Intuitive Data Models

GLUE data models are intuitively to understand because the language natively supports to-many relations and time-constant relations. This removes the need for artificial data model elements like link tables and validity timestamps that otherwise clutter a data model.

The above figure illustrates a very simple "shop-model" that can directly be used by GLUE. For example, there is no need to translate the double-headed arrow between 'Invoice' and 'Article' to a relational link-table because GLUE natively handles to-many relations.

The little lock symbols on the arrows indicate that the status of the referred to object is locked in. This means that, for example, changes to the price of an article are not reflected into an invoice (cf. example 4).

2.Object Tags

Object tags simplify the handling of objects. For example a new customer object for a customer with name "John Smith" can be tagged as "John".

INSERT Customer.(
    first_name := John,
    last_name  := Smith,
    birthdate  := '21 Jun 1970',
    TAG        := John
);

The customer can now be referred to by simply using the word "John". For example, an invoice for customer "John" can be created like this.

INSERT Invoice.(
    date     := TODAY,
    receiver := John,
    items    := (pencil, paper)
);
3.Time Operations

Time operators provide a patented way to shift back in time and access seemingly overwritten information. This feature is possible because GLUE automatically tracks all changes. For example, when the price of the "pencil" article is changed like this,

UPDATE pencil.price := 2 USD;

then this does not overwrite the existing price but rather pushes the new price on top of the existing price. The old prices can still be accessed using time operators. For example the following statement selects all pencil prices in the database.

SELECT pencil.(price SINCE INCEPTION).(BEGIN, VAL);
> BEGIN         VAL
  ----------------------
  2020-10-21    2.00 USD
  2018-07-20    1.99 USD
  2017-01-01    1.79 USD

Time operators hugely simplify the handling of time in a computer program. For example, the following statement uses the time operator AT to calculate the price difference of a pencil between today and 1 Jan 2018.

SELECT pencil.price - pencil.price AT '1 Jan 2018');
> col_0
  --------
  0.21 USD

And the best thing is that time operators are completely transparent, i.e. if you are not interested in past information that you just do not use a time operator and GLUE works like any normal programming language. For example, the current pencil price is select just like in any other language.

SELECT pencil.price;
> price
  --------
  2.00 USD
4.Time-Constant Relations

Time-constant relations lock in the status of an object at the moment of assignment. For example, the pencil price in the invoice of customer "John" is still 1.99 USD although the pencil price has been changed to 2 USD in the previous example.

SELECT John.invoices.items.(name, price);
> name      price
  ------------------
  pencil    1.99 USD
  paper     4.99 USD
5.Units and Dimensions

GLUE natively supports units and dimensions. For example, the price of an article is not just a plain number but a tuple of a number and a currency, e.g. "0.99 USD" or "1.99 EUR". GLUE also supports automatic unit conversion.

SELECT 1 USD + 1 EUR;
> 2.1693 USD

The conversion factor of currencies is time dependent, therefore the above statement returns a different result when used in combination with a time operator.

SELECT (1 USD + 1 EUR) AT '20 Feb 2018';
> 2.2338 USD
6.Convenience Aggregation

GLUE defines a convenience aggregator (+) for all elements. For example, "1+2" is "3", "pencil + pencil" is "2 pencil", and "pencil + paper" is the list "(pencil, paper)". Convenience aggregation is also defined on paths. For example, the following statement aggregates the price over all items of all invoices.

SELECT +Invoice.items.price;
> price
  --------------
  104,325.17 USD

Moving down the plus operator in the path provides a simple and easy to use drill-down functionality.

SELECT Invoice.+items.price;
> price
  ----------
  532.00 USD
   32.50 USD
   98.10 USD
  (352 more)
7.Forgery-Proof Versioning System

Time operators can not only be used to select past information but also to change past information (e.g. to correct erroneous data entries). For example, the following statement changes the pencil price at 20 July 2018 from currently 1.99 USD to 1.88 USD.

UPDATE pencil.price AT '20 Jul 2018' := 1.88 USD

However, GLUE tracks the date and time when a change is actually executed and thus back-dated changes can always be identified.

SELECT pencil.(price SINCE INCEPTION).(BEGIN, INSERT, VAL);
> BEGIN         INSERT        VAL
  ------------------------------------
  2020-10-21    2020-10-21    2.00 USD
  2018-07-20    2020-10-21    1.88 USD
  2017-01-01    2017-01-01    1.79 USD
8.Full Audit Compliance

GLUE provides the ASOF operator to execute any statement as-of a past date. GLUE's versioning system guarantees that the "ASOF" result is identical to the original result. For example, the following statement is executed as-of yesterday and returns a pencil price of 1.99 USD which is exactly what the query "SELECT pencil.price" would have returned yesterday.

SELECT pencil.price ASOF YESTERDAY;
> price
  --------
  1.99 USD

It is noteworthy that the ASOF operation applies to data as well as to the model, i.e. the entire system is consistently set back to a past state.

9.Derived Properties (coming soon)

Derived properties are properties that use program code to derive their value from other information. A very simple example is the derived property "age" that calculates the age of a customer based on its birthdate.

INSERT Customer.age := {
    RETURN (TODAY - birthdate) IN Year;
};

A derived property can be used like a normal (read-only) property. For example the following statement selects the birthdate and age of customer "John".

SELECT John.(birthdate, age);
> birthdate     age
  ---------------------
  1970-06-21    50 Year
10.Class Clustering (coming soon)

A cluster is a set of objects. For example, a cluster "Adult" can be defined as the set of all customers that are older than 18 years.

INSERT CLUSTER.(
    TAG       := Adult,
    SOURCE    := Customer,
    CONDITION := { age >= 18 Year; }
 );

Clusters allow concise statements (e.g. "if Peter is Adult") and can also be used for implicit input validation.

INSERT Adult.(
    first_name := Tiny,
    last_name  := Tim,
    birthdate  := '1 Jun 2012'
);
> ERROR: Token does not belong to cluster 'Adult'.
11.Code Historicization (planned)

Code historicization allows to change the code logic while still working with the latest version of the data.

This is particularly useful in the business world where business rules often change over time. For example, a government might decide that, beginning with 1 July 2018, a person is considered an adult from the moment it is 17 years old. With code historicization the required code change is simply done like this.

UPDATE Adult.CONDITION SINCE '1 Jul 2018' := { age >= 17 Year; };

By default the new logic is used, however the old logic is still accessible by using time operators. For example, the following statement counts the number of adults using the different logics.

SELECT (
    Adult.COUNT,
    Adult.COUNT LOGIC AT '30 Jun 2018'
);
> COUNT    COUNT_1
  ----------------
  24       23