Home > Engineering > Mycelium > Kafka

Kafka

In Mycelium, Kafka is about data in motion: data change records in topics, each one an immutable record of what changed. Where Git keeps state at a slow heartbeat, Kafka carries what moves. What is built so far is the record and a simple topic; most of what follows is the direction. For Kafka on its own terms, see the Kafka subject.

What is built

The record is the elementary container of data. It is compatible with Kafka’s record, with only the properties needed so far: its topic, key, offset, timestamp, headers and value. The data is the value, and the value’s schema is the data’s schema; metadata goes in the headers.

Data lives in topics, in Kafka’s sense, a single partition each for now. A topic is to be typed: named by the type of what it holds, never by a generic word such as “log”. Kafka’s names are used with Kafka’s meaning, and our own additions get names of their own.

Where records are the base, state is built from them, never written beside them. In an mrepo, the requests already run this way: they arrive in an inbox topic, are kept in a topic once done, and leave through an outbox topic, each reader keeping its own position.

The direction: Kafka on peers

On the peer-to-peer substrate, a partition becomes a Hypercore and an offset a position in it. There is no central broker: what a broker does is taken on by the peers. That has consequences:

The documentation as built is in base-docs-package, and the direction in base-docs-vision.