Expand description

Universal Embedded CRDTs for Distributed Coordination
CRDTosphere is a comprehensive no_std Rust library implementing Conflict-free Replicated Data Types (CRDTs)
optimized for embedded systems. It provides ultra-efficient, configurable CRDT implementations for automotive,
robotics, IoT, and industrial applications across multiple platforms.
§Features
- Universal Platform Support - AURIX, STM32, ARM Cortex-M, RISC-V
- Configurable Memory - 2KB to 1MB+ budgets with compile-time verification
- Multi-Domain Ready - Automotive, robotics, IoT, industrial applications
- Safety Critical - ISO 26262, IEC 61508, DO-178C compliance support
- Ultra-Efficient - 5-100 byte CRDT instances with hardware optimizations
- No Dynamic Allocation - Pure static allocation for deterministic behavior
- Real-Time Guarantees - Bounded execution time (<1000 CPU cycles)
§Feature Overview
§Domain-Specific Features
automotive- Automotive ECU and safety-critical systems (ISO 26262, ASIL-D)robotics- Robotics and autonomous systems coordinationiot- Internet of Things and sensor networksindustrial- Industrial automation and control systems
§Platform-Specific Features - Mostly mutually exclusive
aurix- AURIX TriCore automotive MCUs (multi-core, safety features)stm32- STM32 ARM Cortex-M MCUs (power management optimizations)cortex-m- Generic ARM Cortex-M platforms (memory constrained)riscv- RISC-V embedded processors (variable multi-core)
§Hardware Optimization Features
hardware- Enable all hardware optimizationshardware-atomic- Hardware atomic operations for thread safety
§Serialization Features
serde- Serde serialization support (no_std compatible)
§Platform Support Matrix
| Feature | AURIX | STM32 | Cortex-M | RISC-V | Default |
|---|---|---|---|---|---|
| Memory Alignment | 32-byte | 4-byte | 4-byte | 8-byte | 4-byte |
| Max Merge Cycles | 500 | 200 | 100 | 300 | 150 |
| Multi-core | ✅ (3 cores) | ❌ | ❌ | ✅ (variable) | ❌ |
| Safety Features | ✅ ASIL-D | ❌ | ❌ | ❌ | ❌ |
| Power Management | ❌ | ✅ | ✅ | ❌ | ❌ |
| Real-Time Bounds | ✅ (100μs) | ✅ (50μs) | ✅ (25μs) | ✅ (30μs) | ✅ (40μs) |
Note: Platform features are mutually exclusive. Choose one per build.
§Platform-Specific Usage Examples
§AURIX TriCore (Automotive Safety-Critical)
[dependencies]
crdtosphere = { version = "0.1", features = ["automotive", "aurix", "hardware-atomic"] }§STM32 (IoT/Industrial)
[dependencies]
crdtosphere = { version = "0.1", features = ["iot", "stm32", "serde"] }§Generic Cortex-M (Robotics)
[dependencies]
crdtosphere = { version = "0.1", features = ["robotics", "cortex-m"] }§RISC-V (Research/Custom)
[dependencies]
crdtosphere = { version = "0.1", features = ["industrial", "riscv", "hardware-atomic"] }§Quick Start
use crdtosphere::prelude::*;
// Define memory configuration for your platform
define_memory_config! {
name: MyPlatformConfig,
total_memory: 32 * 1024, // 32KB budget
max_registers: 100,
max_counters: 50,
max_sets: 20,
max_maps: 10,
max_nodes: 32,
}
fn example() -> Result<(), CRDTError> {
// Use configurable CRDTs
let mut sensor_reading = LWWRegister::<i16, MyPlatformConfig>::new(1);
sensor_reading.set(42, 1000)?; // 1000 is your timestamp here.
// Automatic conflict resolution
let other_node_reading = LWWRegister::<i16, MyPlatformConfig>::new(2);
sensor_reading.merge(&other_node_reading)?;
Ok(())
}§CRDT Types Available
§Counters
§Registers
LWWRegister- Last-Writer-Wins registerMVRegister- Multi-Value register (concurrent writes preserved)
§Sets
§Maps
LWWMap- Last-Writer-Wins map
Modules§
- automotive
automotive - Automotive Domain CRDTs
- clock
- Clock management module
- configs
- Configuration presets module
- counters
- Counter CRDT implementations
- error
- Error handling module for CRDTosphere
- industrial
industrial - Industrial Domain CRDTs
- iot
iot - IoT Domain CRDTs
- maps
- Map CRDT implementations
- memory
- Memory management module for CRDTosphere
- platform
- Platform-specific constants and optimizations
- prelude
- Prelude module of CRDTosphere
- registers
- Register CRDT implementations
- robotics
robotics - Robotics Domain CRDTs
- sets
- Set CRDT implementations
- traits
- Core CRDT traits module
Macros§
- define_
memory_ config - Macro to define a custom memory configuration