Skip to main content
Documentation

Project Graph

Multigraph

linkparallel linksloopEntityEntityEntityEntityEntityEntityEntityProjectEntity(root)EventEventEventEventEventEventEvent

Technically, a project graph is a finite directed multigraph that may contain loops. Every project branch has exactly one project graph with exactly one project entity as root. The graph consists of elements (entities, links and events). The graph's nodes are called entities and represent the central units of information. Each entity is identified via a project-wide unique entity id. Entities are connected via directed links, the graph's edges. Entities can be linked in both directions. There can be multiple parallel links between the same entities with different link ids (multigraph). Events are temporary elements. Each is related to an entity and is removed automatically when its lifespan has expired. Events can, for example, trigger function evaluations and implement event-driven models.

Elements

Every project graph is built from three basic elements. Entities and links are mutable: they can be created, updated and removed at any time, and they exist for as long as they are needed. An entity can hold binary content of any kind. A link connects two entities in one direction. Events are immutable and exist only for a limited time.
sourcetargetentityElementTypeAttributesMeta AttributesTagsMutable ElementVersionImmutable ElementEntityEntity IdEntity BranchContentLinkLink IdContentEventEvent IdOccurrence IdDuration

Traversal

Each link is directed and links a specific source entity to a specific target entity. However, the graph can be traversed in both directions, forwards and backwards.

Project Branching

A project consists of at least one project branch, called the main branch. Forking an existing project branch creates a new one.
project / main branchEntityEntityEntityEntityEntityProjectEntity(root)forkproject / main branchEntityEntityEntityEntityEntityProjectEntity(root)project / fork branchEntityEntityEntityEntityEntityProjectEntity(root)

Entity Branching

Entity branching branches single entities or whole subgraphs, for example to run the computation branches of a simulation in parallel or to save a specific state.
every entity on “main”Entity(main)Entity(main)Entity(main)Entity(main)Entity(main)Entity(main)ProjectEntity(main)branchthe subgraph on “fork”Entity(main)Entity(main)Entity(main)Entity(fork)Entity(fork)Entity(fork)ProjectEntity(main)on the “main” entity branchon the “fork” entity branch

In the illustrated project graph the blue subgraph is forked from the "main" entity branch to the "fork" entity branch. The resulting subgraph is visualized in amber.

Garbage Collection

The garbage collector automatically removes all unreachable entities, links and events. An entity is reachable if the project entity links to it, directly or indirectly, in the forward direction. Unreachable elements are removed no earlier than 24 hours after their creation, so a function can create temporary unreachable entities (or subgraphs) for its computations.
EntityEntityEntityEntityProjectEntity(root)EventEventEntityEntityEntityEntityEventEventreachable from the project entitynot reachable, so the garbage collector removes it

The red entities, links and events of the illustrated project graph would be removed by the garbage collector because they are not reachable from the project entity.

Scalability

The graph is designed for large data. It is stored in a distributed way, so that reads, writes and data volume can scale out. In practice its size is limited by the account's subscription quotas. When the quotas are exhausted, all projects are deactivated automatically until quota is free again.

Consistency

There are two consistency modes, weak and strong. Weak transactions give the most scalability and performance; strong transactions give a higher level of consistency. Diafunc is an analytical platform, so for most use cases the recommendation is weak transactions, eventual consistency, deliberate data redundancy, idempotent operations, and functions that map between immutable data structures.

Transactions

In both consistency modes, a transaction is invisible to others until it is committed. A function evaluation works on a transactional view of the project graph: its changes are visible only within its own transaction. Committing the transaction applies the changes to the global project graph. A transaction that is neither committed nor reverted when the evaluation finishes is committed automatically.
inside the transaction+ link− linkEntityEntityEntityEntityProjectEntity(root)Event−Entity+what everyone else seesEntityEntityEntityEntityProjectEntity(root)Eventreadcommit+ added by the transaction− removed by the transaction

In the left panel the elements marked + are added and the elements marked − are removed by the transaction; the right panel shows the global project graph as others see it until the transaction is committed.

Tree View

The Tree View displays the project graph as a tree originating from the project entity as root.

Graph View

The Graph View displays the project graph around the currently opened entity. That entity sits in the middle, and everything linked to it sits on a ring around it; entities further away sit on further rings. Every entity shows its type's icon, its name and its type, and every link is drawn as a line named after its link id, with an arrow for the way it runs. Parallel links between the same two entities share one line, and a link from an entity to itself is drawn as a loop.
  • A click selects an entity or a link. Its ids appear below the graph, ready to copy.
  • An entity with a dashed outline has links that are not shown yet. Its + handle loads them, and the new entities join the rings without moving the ones already there.
  • A double-click opens an entity or a link. The right-click menu holds the rest: opening in a new tab, loading or collapsing links, hiding, and, when you may edit the project, adding, linking, unlinking and removing. Unlinking and removing ask first.
  • Entities can be dragged. They keep their place until the graph is laid out again.
  • Zoomed out, the names of the entity in the middle, the selected one, search hits and the entities with the most links stay readable, as many as fit without covering each other.
  • The search button finds entities by name or type. The toolbar also zooms, fits the whole graph, loads every link not yet shown, starts over, downloads the graph as PNG or SVG, and shows it full screen.
  • The graph works from the keyboard. The arrow keys move to the nearest entity in that direction, Enter selects, Space loads the links, the menu key or Shift+F10 opens the menu, L moves on to the entity's links, and Home returns to the middle.

What next?