Project Structure
The workspace members are listed in the root
Cargo.toml, which is
the authority when this page and the tree disagree. Each group directory under
crates/ and services/ has a README saying what it holds.
Top level
Section titled “Top level”felix/├── crates/│ ├── protocol/ felix-wire, felix-transport, felix-mqtt-wire│ ├── server/ felix-broker, felix-storage, felix-kafka, felix-replication,│ │ felix-router, felix-authz, felix-common, felix-mqtt│ ├── sdk/ felix-client, felix-capi, felix-python*, felix-typescript*│ ├── testing/ felix-cluster, felix-conformance, felix-loadgen,│ │ felix-sim│ └── tools/ felixctl├── services/│ ├── felix-broker-service/ builds the felix-broker binary│ └── felix-controlplane-service/ builds the felix-controlplane binary├── sdks/dotnet/ the C# client (Felix.Client), built with dotnet├── demos/│ ├── broker/ demo binaries of felix-broker-service│ └── slow-consumer/*, state-divergence/*, rbac-live/*, cross_tenant_isolation/*├── docs/ design docs, specs, formal/ (TLA+), security/├── docs-site/ this site (Astro Starlight)├── docker/ broker, controlplane, prometheus, otel-collector Dockerfiles├── deploy/helm/felix/├── scripts/ CI checks, perf pipeline, cluster demo helpers├── vendor/ vendored crates, recorded in VENDORED.toml├── githooks/ pre-commit and pre-push└── .github/workflows/Entries marked * declare their own [workspace] and are not members:
the two language bindings, which build with maturin and napi-rs, and four demo
crates. task python:check, task ts:check and task demo:check build them.
The fuzz crates under crates/*/*/fuzz/ are outside the workspace too, because
cargo-fuzz needs nightly.
Crates
Section titled “Crates”Dependencies point one way. sdk and server depend on protocol, testing
depends on whatever it exercises, tools depends on sdk, and protocol
depends on nothing else in the repository. The release workflow publishes five
crates to crates.io: felix-wire, felix-transport, felix-client,
felix-loadgen and felixctl. Every other crate sets publish = false, except the Python and Node bindings, which ship as a wheel and an npm package.
Protocol
felix-wire: the frame codec. The frame header and flags, theMessageenum, the binary batch formats and the broker-to-broker messages. No I/O. docs/protocol.md is its specification.felix-transport: the QUIC layer. Endpoints, connection and stream lifetime, and transport tuning shared by client and broker.felix-mqtt-wire: the MQTT 3.1.1 and 5.0 packet codec, with its limits enforced while decoding. It is internal to the repository.
Server
felix-broker: the broker’s semantics. Streams, caches and consumer groups over one log, the publish path (broker/publish.rs) and fanout (stream/delivery.rs). Start atBroker.felix-storage: a log-structured segment store and the caches projected from it. See below.felix-kafka: the Kafka listener. It answers Kafka consumers from the broker’s shard logs and accepts producers.felix-mqtt: the MQTT 3.1.1 and 5.0 listener and its mounts onto streams and caches. A device can publish at QoS 0 and 1 to a mounted stream; subscribing is refused for now (service/refuse.rs).felix-replication: broker-to-broker transport (peer/, including its mTLS inpeer/tls.rs) and log replication (driver/,replica.rs,quorum.rs,promotion.rs,reporter.rs). It does not depend on the broker service, which plugs in through small traits.felix-router: which node serves a shard, from the control plane’s assignments.felix-authz: tokens, JWKS and permission matching.felix-common: what the broker and control plane must agree on exactly:membership,fleet,clock(including the test-only clock fault seam),tls,lifecycle,ids,error, andenv_registry, the list of everyFELIX_*variable.
SDK
felix-client: the Rust client. Start atClient.felix-capi: the C ABI overfelix-client, the base for the Go and C# SDKs.felix-python,felix-typescript: pyo3 and napi bindings overfelix-client.sdks/dotnet: the C# client. It bindsfelix-capiand is built withdotnet, not cargo.
Tools
felixctl: the command-line client. Publish, subscribe, read caches, manage the control plane and run benchmarks.
Testing
felix-cluster: a real multi-node cluster on one machine, with fault injection and the history checker. A library for tests and a CLI (task cluster:up). See How Felix Is Tested.felix-conformance: the client conformance catalogue and verifier.felix-sim: the deterministic simulator. Brokers, the control plane and an in-memory network and filesystem run from a seed on virtual time, with checkers for the histories they record.felix-loadgen: the load generator for the real-network performance suite.
felix-storage
Section titled “felix-storage”A segment store, not a WAL. The crate docs in src/lib.rs are the map:
log.rs: theAppendOnlyLogtrait and its types.disk_log.rsanddisk_log/: the durable log.append.rs(the append path, which runs on the log’s append thread, and background rollover),flush.rs,sync/(fsync policy and group commit),segments/(withrolloverandtruncation),recovery/(startup validation and torn-tail repair),retention.rs, and the per-shard state files (durable_mark,replica_state,ballot,epochs,producers).segment.rsandsegment/: one segment file.format(the byte format),scan(torn tail or corruption),reader,writer,cursor, and the sparseindex.io.rs: positioned reads, preallocation and flushes (F_FULLFSYNCon macOS), andlog_thread, the per-log threads appends and flushes run on.tiered.rs: the interface for moving sealed segments to cold storage. Only the interface exists; nothing implements it yet.cache.rs(EphemeralCacheandLogCache) andcounter_log.rs: stores projected from their own logs, compacted in the background bycompaction.rs.commit_order.rs: theCommitSequencerthat orders publishes per log.fault.rs: the test-only fsync fault seam.fs.rs: where storage reaches the filesystem, so a simulation can keep a data directory in memory.sim_fs.rsis that in-memory filesystem and its power-loss model.
docs/durable-storage.md and docs/storage-format.md describe the design.
Services
Section titled “Services”services/felix-broker-service is the broker process. serving/ is the client
side (quic/ decodes frames and holds the publish and subscribe handlers, plus
auth, forward, kafka and limits). cluster/ talks to the control plane
(lease, membership, credential, catalog_sync). node.rs and node/
wire it together and gate readiness on the control-plane seed. shards/ covers shard lifecycle and
routing, restore.rs is the felix-broker restore-point subcommand, and
observability/ serves metrics. It also builds the demos/broker/* binaries and the soak harness.
services/felix-controlplane-service is the REST control plane: api/,
store/ (memory or Raft), raft/, cluster/ (membership and
placement) and auth/. The operator commands over its API are in felixctl.
demos/broker/ holds the demos that run an in-process broker, built as
binaries of felix-broker-service: simple_pubsub_demo, cache_demo,
latency_demo, notifications_demo, orders_demo, durable_restart_demo and
queue_semantics_demo.
demos/slow-consumer, demos/state-divergence, demos/rbac-live and
demos/cross_tenant_isolation are standalone crates outside the workspace.
Run task demo:check after changing a public API they might use.
Docs, deployment and CI
Section titled “Docs, deployment and CI”docs/: design docs and specifications, includingprotocol.md,durable-storage.md,storage-format.md,replication-design.md,cluster-harness.md,history-checker.md,kafka-compatibility.md, the TLA+ models informal/and the security reviews insecurity/.docs-site/src/content/docs/: this site. The home page isindex.mdx.docker/*.Dockerfile: the broker and control-plane images, plus Prometheus and an OpenTelemetry collector for local stacks.deploy/helm/felix/: the Helm chart, checked bytask chart:check..github/workflows/: among othersci,coverage,history,fuzz-nightly,soak,pages,release,cla,perf-pr,perf-publishandperf-comprehensive. Building & Testing says what each runs.
Licences differ by path. LICENSING.md has the table, and deny.toml lists the dependency licences allowed.
Layout rules
Section titled “Layout rules”These come from CONTRIBUTING.md; Contributing summarises them.
- A module
fooisfoo.rswith its children infoo/. There is nomod.rs, excepttests/common/mod.rsfor helpers shared between integration-test binaries. lib.rsholds the crate docs, module declarations and re-exports, not code.- Unit tests live in
<module>/tests.rs, declared last in the module as#[cfg(test)] mod tests;. Integration tests live in the crate’stests/. pubmeans another crate uses it. Everything else ispub(crate).- Crate names start with
felix-, and the directory is named after the package. - Shared dependency versions live in
[workspace.dependencies].
