Skip to content
CAI
Software that uses CAICheck a score

emqx/mria

64.9

Adequate · 2 October 2026

7.8k

lines of production code

Erlang

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Mria is an Erlang extension for Mnesia that provides eventual consistency to distributed clusters by separating nodes into core and replicant roles. It enables passive data replication via RLOG shards and RPC, allowing local reads without write locks while maintaining transactional integrity on core nodes. The system supports advanced features like merge tables, configurable shard settings, and automatic healing from network partitions, backed by comprehensive testing for fault tolerance and version compatibility.

Features

Add Mria header definitions for membership and replica status

The include/mria.hrl file has been added, defining the core data structures and types for the Mria module. This includes the \#member record, which now explicitly tracks the node's role via the role field, and the \#mria\_replica\_status\_update record for tracking shard replica states. It also defines the member\_status type (joining, up, healing, leaving, down) and establishes the JOIN\_LOCK\_ID macro to guard join operations.

include · high confidence

Added script to build and test against old release tags

A new build script, scripts/build-old-rel, has been added to facilitate testing interoperability with previous releases. This script clones the repository at a specified git tag, sets up a symlinked RocksDB dependency to avoid redundant builds, and compiles the project using rebar3, enabling verification that current code functions correctly against older release versions.

scripts · high confidence

Initial release of Mria with RLOG-based eventual consistency

Introduces Mria, an extension for Mnesia that adds eventual consistency to clusters by separating nodes into 'core' and 'replicant' roles. Core nodes handle transactions in a full mesh, while replicants passively replicate data via RPC, allowing local reads without participating in write locks. The system uses RLOG shards to group tables for independent replication and supports 'merge tables' for node-specific records. This initial release includes the core API (mria:transaction, mria:ro\_transaction), configuration for shard assignment, and build tooling via rebar3 with dependencies like gen\_rpc and mnesia\_rocksdb.

(repo-wide) · high confidence

Behavioural changes

Mria 0.2.13: Major refactor, Classy integration, and new replication features

This release introduces a significant architectural shift by migrating cluster management from Mnesia to the Classy library, enabling new capabilities such as merge tables, dirty shard support, and a RocksDB backend. Users gain new API functions including sync\_transaction, match\_delete, and dirty\_update\_counter, while the system now supports configurable shard-level settings and improved autoheal logic for partition recovery. The default RPC module has changed from gen\_rpc to the standard rpc module, and the application now integrates with Classy hooks for node classification and cluster lifecycle events.

src · high confidence

Test coverage

Added cluster benchmarking and network fault injection test infrastructure; Expanded test coverage for cluster stability and fault tolerance.

Housekeeping

Added RLOG internals documentation and diagrams

Added a new developer guide (\doc/rlog\_internals.md\) and supporting UML diagrams (\replicant-fsm.uml\, \replication-msc.uml\) that document the internal architecture of the RLOG replication system. The documentation details the roles of the RLOG server, agent, replica, and bootstrapper processes, explains the transaction interception mechanism via a patched OTP version, and illustrates the bootstrapping and normal operation protocols through sequence and state machine diagrams.

doc · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 66 → 65 (-1.4)
  • Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 92 → 92 (+0.0)
  • Architecture 100 → 84 (-16.3)
  • Maturity 52 → 52 (+0.0)
  • Readiness 64 → 64 (+0.0)
  • Security 92 → 95 (+2.7)

Resolved (4)

  • Coverage not measured — no coverage collector is wired up
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

New (4)

  • Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
  • No dependency lockfile committed (rebar.config)
  • Off-boarding risk: anonymized user #1
  • Projects may be oversized for their cohesion

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

emqx/mria was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 527d084963d4a362f6c04c87be3401e7feaef0b6 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.