Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Domain Model

This page describes the vocabulary Yuneta uses to model reality: realms, entities, relationships, messages, and the CRUDLU operations on them. It is the concrete counterpart to the Design Principles (why the framework is built this way) and to the Inspiration page (where the words come from).

In Yuneta we seek models (patterns) that allow us to represent and visualize all kinds of realities.


Realms

Yuneta systems are organized into realms.

Each realm has three properties:

PropertyDescription
RoleClass of the realm
NameInstance of the realm
OwnerOwner of the realm

Realm Terms

The frontend URL defines which realm the user wants to enter. The owner of a realm can add other users and define their authorization levels.


Entity/Relationship Model

We describe reality by classifying it into Entities and the Relationships between them.

    ┌────────────┐         ┌────────────┐
    │  Entity A  │─────────│  Entity B  │
    └────────────┘         └────────────┘
         │          relationship
         │
    ┌────────────┐
    │  Entity C  │
    └────────────┘

Entities

We describe entities using the pair model:

ModelAlso known as
Role / InstanceClass / Object
Table / Record
Group / Element
    ┌──────────────────┐
    │    Role (Class)   │
    ├──────────────────┤
    │  instance 1      │
    │  instance 2      │
    │  instance 3      │
    │  ...             │
    └──────────────────┘

Relationships

We describe relationships also using pair models:

    Parent ──creates──► Child

    Client ──connects──► Service

Message Transport

Entities exchange messages through their relationships (links).

Behavior patterns:


Message Content

The data model used in message content — both internally and externally, for persistence and transport — is key/value.

    ┌──────────┬──────────┐
    │   Key    │  Value   │
    ├──────────┼──────────┤
    │ name     │ "Alice"  │
    │ age      │ 30       │
    │ enabled  │ true     │
    └──────────┴──────────┘

Yuneta can also add the time-series model to transported messages:

    ┌──────────┬──────────┬─────────────────────┐
    │   Key    │  Value   │     Timestamp        │
    ├──────────┼──────────┼─────────────────────┤
    │ temp     │ 22.5     │ 2024-01-15 10:00:00 │
    │ temp     │ 23.1     │ 2024-01-15 10:01:00 │
    │ temp     │ 22.8     │ 2024-01-15 10:02:00 │
    └──────────┴──────────┴─────────────────────┘

Encoding and Persistence

All models are represented in JSON, both in memory and on disk, using:

Example topologies:

    Tree (hierarchical):          Graph:

         A                      A ─── B
        / \                     │ \   │
       B   C                    │  \  │
      / \                       C ── D
     D   E


    Key/Value:                  Time-Series:

    ┌─────┬───────┐            ──●──●──●──●──●──► t
    │ k1  │ v1    │              v1  v2  v3  v4
    │ k2  │ v2    │
    └─────┴───────┘

CRUDLU

Most systems describe entities with the classic CRUD operations:

Yuneta adds two more because the TreeDB graph store makes relationships first-class citizens, not foreign keys managed by convention:

CRUDLU = Create, Read, Update, Delete, Link, Unlink. Every TreeDB API call is one of these six shapes.

Where to go next