You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write your data pipeline once. Run it on microcontrollers, edge gateways or Kubernetes — no code changes. AimDB's portable data contracts handle serialization, transforms and schema evolution across all runtimes.
25
+
AimDB turns data contracts into the architecture. Define your schemas once — with built-in versioning, observability and serialization — and deploy them unchanged across microcontrollers, edge gateways, Kubernetes and the browser.
A future where every system — from a $2 sensor to a global fleet — shares one data language. Contracts define how data moves, evolves and is observed. Infrastructure adapts to the data, not the other way around.
32
+
33
+
---
34
+
35
+
### Design Philosophy
36
+
37
+
In a data-driven architecture, every design decision starts with the data, not the service that produces it.
38
+
39
+
**Records declare their own semantics.** When you register a record in AimDB, you choose a buffer type that defines how the data moves:
These are the three universal primitives of data movement — portable, typed and runtime-agnostic.
48
+
49
+
**Observability becomes automatic.** A record that exists is observable by definition. Every producer and consumer relationship is declared in the builder, not discovered through instrumentation.
50
+
51
+
**Synchronization becomes declarative.** You don't build a sync layer between your MCU, edge gateway and cloud backend. You declare a record with connector metadata on its key and the same typed data flows across all environments without translation.
52
+
53
+
**Cross-cutting concerns derive from the schema.** Instead of adding observability libraries, feature flag SDKs and experiment frameworks as separate integrations, they become intrinsic properties of records — declared once, applied everywhere.
54
+
55
+
---
56
+
57
+
### How It Works
58
+
59
+
Define your contracts, choose buffer semantics and wire up connectors — all in one builder block:
60
+
61
+
```rust
62
+
// A sensor node: produce temperature readings, publish over MQTT
.tap(log_tap::<Temperature>("edge")) // [edge] 22.5 °C
83
+
.finish();
84
+
});
85
+
```
86
+
87
+
Transport topics can be passed as strings to `link_to` / `link_from`, or declared on key enums with `#[link_address = "mqtt://..."]` and resolved at runtime. No separate instrumentation. No SDK integration. No sync code.
88
+
89
+
---
90
+
91
+
### Data Contracts
92
+
93
+
Data contracts are the heart of AimDB. A contract is a plain Rust struct that carries its own identity, version and capabilities — the single source of truth from sensor firmware to browser UI.
94
+
95
+
```rust
96
+
useaimdb_data_contracts::{SchemaType, Settable};
97
+
useserde::{Deserialize, Serialize};
98
+
99
+
#[derive(Debug, Clone, Serialize, Deserialize)]
100
+
pubstructTemperature {
101
+
pubcelsius:f32,
102
+
pubtimestamp:u64,
103
+
}
104
+
105
+
implSchemaTypeforTemperature {
106
+
constNAME:&'staticstr="temperature";
107
+
constVERSION:u32=1;
108
+
}
109
+
110
+
implSettableforTemperature {
111
+
typeValue=f32;
112
+
fnset(value:Self::Value, timestamp:u64) ->Self {
113
+
Self { celsius:value, timestamp }
114
+
}
115
+
}
116
+
```
117
+
118
+
This struct compiles for `no_std` embedded targets and standard Rust alike. `SchemaType` gives the record its identity and version. `Settable` provides a canonical constructor so producers can create records from a raw value — this is the interface used by `producer.send(Temperature::set(reading, now()))` in the builder.
119
+
120
+
#### Contract Attributes
121
+
122
+
Contracts gain capabilities through trait implementations. Each trait is a compile-time declaration of what a contract *can do*, not a runtime configuration:
123
+
124
+
| Attribute | Trait | What It Enables |
125
+
|-----------|-------|-----------------|
126
+
|**Settable**|`Settable`| Canonical constructor from a raw value — the interface behind `producer.send(T::set(value, ts))`. |
127
+
|**Streamable**|`Streamable`| Cross-boundary transport — WASM, WebSocket, CLI. One registry, zero parallel type systems. |
128
+
|**Migratable**|`MigrationStep`| Bidirectional schema evolution with typed up/down transforms and chained version steps. |
129
+
|**Observable**|`Observable`| Signal extraction for thresholds, logging and monitoring. Icon, unit and `format_log()` built in. |
130
+
|**Linkable**|`Linkable`| Wire-format serialization for connectors — MQTT, KNX and any future transport. |
131
+
|**Simulatable**|`Simulatable`| Realistic test data generation with random walks, trends and configurable parameters. |
132
+
133
+
For example, `Observable` turns a contract into a loggable, monitorable signal:
134
+
135
+
```rust
136
+
implObservableforTemperature {
137
+
typeSignal=f32;
138
+
constICON:&'staticstr="thermometer";
139
+
constUNIT:&'staticstr="°C";
140
+
141
+
fnsignal(&self) ->f32 { self.celsius }
142
+
143
+
fnformat_log(&self, node_id:&str) ->String {
144
+
format!("[{}] {:.1} °C", node_id, self.celsius)
145
+
}
146
+
}
147
+
```
148
+
149
+
Each trait you implement unlocks a capability — contracts without `Observable` simply can't be tapped; contracts without `Linkable` can't be wired to connectors. The type system enforces what your data can do.
150
+
151
+
#### Platform-Agnostic by Design
152
+
153
+
The same contract works across all runtimes without modification:
The Rust type system enforces correctness at compile time. The dataflow engine's buffer semantics enforce flow guarantees at runtime. Connectors wire everything to your infrastructure without an integration layer.
35
166
36
167
---
37
168
38
169
### Getting Started
39
170
40
-
**See it live** — explore a running sensor mesh at [aimdb.dev](https://aimdb.dev)
171
+
#### 1. See it live
172
+
173
+
Explore a running sensor mesh — no setup required:
41
174
42
175
<palign="center">
43
176
<ahref="https://aimdb.dev">
44
177
<img src="assets/demo.gif" alt="AimDB Live Demo" width="600">
45
178
</a>
46
179
</p>
47
180
48
-
**Run locally** — full MCU → edge → cloud mesh in Docker:
181
+
> **[aimdb.dev](https://aimdb.dev)** — live weather stations streaming typed contracts across MCU, edge and cloud.
182
+
183
+
#### 2. Run locally
184
+
185
+
Spin up a full MCU → edge → cloud mesh with one command:
49
186
50
187
```bash
51
188
cd examples/weather-mesh-demo
52
189
docker compose up
53
190
```
54
191
55
-
Then ask VS Code Copilot: *"What's the current temperature from station ...?"* ([MCP setup required](examples/weather-mesh-demo/))
192
+
This starts three weather stations, an MQTT broker and a central hub — all wired together with typed data contracts.
193
+
194
+
#### 3. Explore with AI
195
+
196
+
With the mesh running, connect an MCP-compatible editor to query your data in natural language:
56
197
57
198
<palign="center">
58
199
<imgsrc="assets/copilot-communication.gif"alt="AimDB MCP Live Demo"width="600">
59
200
</p>
60
201
61
-
**Learn more:**
62
-
-[Quick Start Guide](https://aimdb.dev/docs/getting-started) — Dependency setup and API basics
0 commit comments