Introduction to Frois and Core Principles
TL;DR
Frois helps you organize interconnected data by treating everything as a "fact" and structuring it with clear relationships. It focuses on immutability and precise querying to ensure your data stays consistent and easy to explore. Understanding Frois means thinking about your data as a set of verifiable, linked statements.
1. The Mental Model
Imagine you're building a massive, interconnected knowledge graph. Instead of tables or documents, you're constantly adding small, confirmed pieces of information, and linking them together. This graph grows over time, but past information never changes, only new connections or facts are added.
2. The Core Material
Frois is a system for managing data that's designed for immutability, traceability, and interconnection. It's built on a few core principles that guide how you structure, store, and query your information.
What is a "Fact"?
In Frois, the smallest unit of information is a fact. A fact isn't just a row in a table or a field in a document; it's a statement about a relationship or an attribute. This statement typically involves an entity, an attribute, and a value.
For example, instead of a user object { "id": 123, "name": "Alice" }, Frois sees two facts:
[entity ID 123, has_name, "Alice"]
[entity ID 123, is_type, "User"]
These facts are just positive assertions. You don't delete facts; you assert new facts that might contradict old ones or add new information. This is called immutability – once a fact is recorded, it's never removed. This makes auditing and understanding data changes much simpler.
Entities, Attributes, and Values
- Entity: This is the 'thing' you're talking about – a user, a product, a specific event. Entities are identified by a unique ID.
- Attribute: This describes a property or relationship of an entity. Think of it as a "field name" or a "predicate".
- Value: This is the data associated with the attribute for that entity. It can be a string, number, boolean, or even another entity ID.
Together, an entity-attribute-value (EAV) triplet forms a fact. Sometimes you'll see this called an "eavt" tuple where 't' stands for transaction time, indicating when the fact was asserted.
How Data Changes (and doesn't)
Since facts are immutable, when you "update" data in Frois, you're actually asserting new facts that might supersede older ones. Frois keeps a history