@reddb-io/cli 1.21.0-rc.195 โ 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -166
- package/drivers/js/package.json +1 -1
- package/drivers/js/src/documents.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,79 +1,74 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
<p>
|
|
6
|
-
<strong>The AI-first multi-model database.</strong><br>
|
|
7
|
-
Tables ยท Documents ยท Graphs ยท Vectors ยท KV ยท Time-series ยท Queues ยท All in one engine. Ask it anything.
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">RedDB</h1>
|
|
3
|
+
<p align="center"><strong>The AI-first multi-model database.</strong></p>
|
|
4
|
+
<p align="center">Tables. Documents. Graphs. Vectors. KV. One engine. Ask it anything.</p>
|
|
8
5
|
</p>
|
|
9
6
|
|
|
10
|
-
<p>
|
|
11
|
-
<a href="https://github.com/reddb-io/reddb/releases"><img src="https://img.shields.io/github/v/release/reddb-io/reddb?style=
|
|
12
|
-
<a href="
|
|
13
|
-
<a href="
|
|
14
|
-
<img src="https://img.shields.io/badge/rust%20ยท%20sql%20ยท%20typescript-555?style=for-the-badge&labelColor=0b0b0d&label=built%20with" alt="Built with">
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://github.com/reddb-io/reddb/releases"><img src="https://img.shields.io/github/v/release/reddb-io/reddb?style=flat-square" alt="Release"></a>
|
|
9
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-BSL%201.1-blue?style=flat-square" alt="License"></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/@reddb-io/cli"><img src="https://img.shields.io/npm/v/@reddb-io/cli?style=flat-square&label=npm" alt="npm"></a>
|
|
15
11
|
</p>
|
|
16
12
|
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## ๐ฏ Why RedDB?
|
|
22
|
-
|
|
23
|
-
Stop running Postgres + Neo4j + Pinecone + Redis + Mongo + InfluxDB + RabbitMQ. One file. One engine. One query language. All seven models work together seamlessly.
|
|
24
|
-
|
|
25
13
|
> [!IMPORTANT]
|
|
26
|
-
>
|
|
14
|
+
> In RedDB, a `collection` is the named logical container for data. Tables, documents, key-value, graphs,
|
|
15
|
+
> vectors, time-series, and queues are the user-facing models or semantics you use on top of collections.
|
|
16
|
+
> A collection is not a separate hierarchy layer that contains multiple tables and documents beneath it.
|
|
17
|
+
> Instead, `users` can be a collection used as a table, `events` can be a collection used for documents,
|
|
18
|
+
> and `config` can be a collection used as KV. Some models can also coexist in the same collection.
|
|
27
19
|
|
|
28
20
|
---
|
|
29
21
|
|
|
30
|
-
##
|
|
22
|
+
## The Killer Feature: `ASK`
|
|
31
23
|
|
|
32
24
|
```sql
|
|
33
25
|
ASK 'who owns passport AB1234567 and what services do they use?'
|
|
34
26
|
```
|
|
35
27
|
|
|
36
|
-
One command. RedDB searches across tables, graphs, vectors, documents, and key-value stores
|
|
28
|
+
One command. RedDB searches across tables, graphs, vectors, documents, and key-value stores -- builds context -- calls an LLM -- returns a natural-language answer. No pipelines. No glue code. No other database does this.
|
|
37
29
|
|
|
38
30
|
---
|
|
39
31
|
|
|
40
|
-
##
|
|
32
|
+
## 7 Data Models, 1 Engine
|
|
41
33
|
|
|
42
|
-
|
|
34
|
+
Stop running Postgres + Neo4j + Pinecone + Redis + Mongo + InfluxDB + RabbitMQ. RedDB unifies them.
|
|
35
|
+
|
|
36
|
+
The key mental model is simple: the model is how you work with the data, and the collection is where
|
|
37
|
+
that data lives.
|
|
43
38
|
|
|
44
39
|
```sql
|
|
45
|
-
--
|
|
40
|
+
-- Relational rows
|
|
46
41
|
INSERT INTO users (name, email) VALUES ('Alice', 'alice@co.com')
|
|
47
42
|
|
|
48
|
-
--
|
|
49
|
-
INSERT INTO logs DOCUMENT VALUES ({"level":
|
|
43
|
+
-- JSON documents
|
|
44
|
+
INSERT INTO logs DOCUMENT VALUES ({"level":"info","msg":"login"})
|
|
50
45
|
|
|
51
|
-
--
|
|
46
|
+
-- Graph edges
|
|
52
47
|
INSERT INTO network EDGE (label, from_rid, to_rid) VALUES ('CONNECTS', 102, 103)
|
|
53
48
|
|
|
54
|
-
--
|
|
49
|
+
-- Vector similarity search
|
|
55
50
|
SEARCH SIMILAR TEXT 'anomaly detected' COLLECTION events
|
|
56
51
|
|
|
57
|
-
--
|
|
52
|
+
-- Key-value
|
|
58
53
|
KV PUT config.theme = 'dark'
|
|
59
54
|
|
|
60
|
-
--
|
|
55
|
+
-- Time-series metrics (with retention & downsampling)
|
|
61
56
|
CREATE TIMESERIES cpu_metrics RETENTION 90 d
|
|
62
|
-
INSERT INTO cpu_metrics (metric, value, tags) VALUES ('cpu.idle', 95.2, {"host":
|
|
57
|
+
INSERT INTO cpu_metrics (metric, value, tags) VALUES ('cpu.idle', 95.2, {"host":"srv1"})
|
|
63
58
|
|
|
64
|
-
--
|
|
59
|
+
-- Hypertables + partition TTL + continuous aggregates (logs / events / telemetry)
|
|
65
60
|
CREATE HYPERTABLE access_log TIME_COLUMN ts CHUNK_INTERVAL '1d' TTL '90d'
|
|
66
61
|
|
|
67
|
-
--
|
|
62
|
+
-- Append-only tables (audit, ledger, immutable events)
|
|
68
63
|
CREATE TABLE audit_log (id BIGINT, action TEXT) APPEND ONLY
|
|
69
64
|
|
|
70
|
-
--
|
|
65
|
+
-- Message queues (FIFO, priority, consumer groups)
|
|
71
66
|
CREATE QUEUE tasks MAX_SIZE 10000
|
|
72
|
-
QUEUE PUSH tasks {"job":
|
|
67
|
+
QUEUE PUSH tasks {"job":"process","id":123}
|
|
73
68
|
QUEUE POP tasks
|
|
74
69
|
```
|
|
75
70
|
|
|
76
|
-
Same file. Same engine. Same query language
|
|
71
|
+
Same file. Same engine. Same query language.
|
|
77
72
|
|
|
78
73
|
Want to use RedDB as your log store? Start with the
|
|
79
74
|
[Logs Quickstart](./docs/guides/logs-quickstart.md) or the full
|
|
@@ -81,46 +76,44 @@ Want to use RedDB as your log store? Start with the
|
|
|
81
76
|
|
|
82
77
|
---
|
|
83
78
|
|
|
84
|
-
##
|
|
79
|
+
## AI-Native From Day One
|
|
85
80
|
|
|
86
81
|
```sql
|
|
87
82
|
-- Semantic search without managing vectors yourself
|
|
88
83
|
SEARCH SIMILAR TEXT 'suspicious login' COLLECTION logs USING groq
|
|
89
84
|
|
|
90
|
-
-- Auto-embed on insert
|
|
85
|
+
-- Auto-embed on insert -- vectors are created for you
|
|
91
86
|
INSERT INTO articles (title, body) VALUES ('AI Safety', 'Alignment research...')
|
|
92
87
|
WITH AUTO EMBED (body) USING openai
|
|
93
88
|
|
|
94
|
-
-- Context search across all
|
|
89
|
+
-- Context search: find everything related to an entity across all models
|
|
95
90
|
SEARCH CONTEXT '192.168.1.1' FIELD ip DEPTH 2
|
|
96
91
|
|
|
97
|
-
-- Ask questions in plain English
|
|
92
|
+
-- Ask questions in plain English
|
|
98
93
|
ASK 'what vulnerabilities affect host 10.0.0.1?' USING anthropic
|
|
99
94
|
```
|
|
100
95
|
|
|
101
|
-
|
|
96
|
+
RedDB retrieves context from every data model, feeds it to the LLM, and gives you a grounded answer. RAG built into the database layer.
|
|
102
97
|
|
|
103
98
|
---
|
|
104
99
|
|
|
105
|
-
##
|
|
106
|
-
|
|
107
|
-
Swap providers with a keyword. No code changes. Full parity across ASK, embeddings, and model selection.
|
|
100
|
+
## 11 AI Providers
|
|
108
101
|
|
|
109
|
-
|
|
110
|
-
|:---------|:--------|:-------:|:------------:|:----------:|
|
|
111
|
-
| **OpenAI** | `openai` | โ
| โ
| โ
|
|
|
112
|
-
| **Anthropic** | `anthropic` | โ
| โ
| โ* |
|
|
113
|
-
| **Groq** | `groq` | โ
| โ
| โ
|
|
|
114
|
-
| **OpenRouter** | `openrouter` | โ
| โ
| โ
|
|
|
115
|
-
| **Together** | `together` | โ
| โ
| โ
|
|
|
116
|
-
| **Venice** | `venice` | โ
| โ
| โ
|
|
|
117
|
-
| **DeepSeek** | `deepseek` | โ
| โ
| โ
|
|
|
118
|
-
| **HuggingFace** | `huggingface` | โ
| โ
| โ
|
|
|
119
|
-
| **Ollama** | `ollama` | โ | โ
| โ
|
|
|
120
|
-
| **Local** | `local` | โ | feature-gated | feature-gated |
|
|
121
|
-
| **Custom URL** | `https://...` | varies | โ
| โ
|
|
|
102
|
+
Swap providers with a keyword. No code changes.
|
|
122
103
|
|
|
123
|
-
|
|
104
|
+
| Provider | Keyword | API Key | ASK / Prompt | Embeddings |
|
|
105
|
+
|:------------|:---------------|:-------:|:------------:|:----------:|
|
|
106
|
+
| OpenAI | `openai` | Yes | โ
| โ
|
|
|
107
|
+
| Anthropic | `anthropic` | Yes | โ
| rejected |
|
|
108
|
+
| Groq | `groq` | Yes | โ
| โ
|
|
|
109
|
+
| OpenRouter | `openrouter` | Yes | โ
| โ
|
|
|
110
|
+
| Together | `together` | Yes | โ
| โ
|
|
|
111
|
+
| Venice | `venice` | Yes | โ
| โ
|
|
|
112
|
+
| DeepSeek | `deepseek` | Yes | โ
| โ
|
|
|
113
|
+
| HuggingFace | `huggingface` | Yes | โ
| โ
|
|
|
114
|
+
| Ollama | `ollama` | No | โ
| โ
|
|
|
115
|
+
| Local | `local` | No | feature-gated | feature-gated |
|
|
116
|
+
| Custom URL | `https://...` | depends | โ
| โ
|
|
|
124
117
|
|
|
125
118
|
Most providers speak the OpenAI-compatible `POST /embeddings` shape;
|
|
126
119
|
HuggingFace has its own (`POST /pipeline/feature-extraction/{model}`)
|
|
@@ -159,12 +152,12 @@ curl http://127.0.0.1:5000/config
|
|
|
159
152
|
|
|
160
153
|
---
|
|
161
154
|
|
|
162
|
-
##
|
|
155
|
+
## Probabilistic Data Structures
|
|
163
156
|
|
|
164
|
-
Built-in approximate data structures for real-time analytics at scale.
|
|
157
|
+
Built-in approximate data structures for real-time analytics at scale.
|
|
165
158
|
|
|
166
159
|
```sql
|
|
167
|
-
-- HyperLogLog: unique
|
|
160
|
+
-- HyperLogLog: count unique visitors (~0.8% error, ~16KB memory)
|
|
168
161
|
CREATE HLL visitors
|
|
169
162
|
HLL ADD visitors 'user1' 'user2' 'user3'
|
|
170
163
|
HLL COUNT visitors
|
|
@@ -174,7 +167,7 @@ CREATE SKETCH click_counter WIDTH 2000 DEPTH 7
|
|
|
174
167
|
SKETCH ADD click_counter 'button_a' 5
|
|
175
168
|
SKETCH COUNT click_counter 'button_a'
|
|
176
169
|
|
|
177
|
-
-- Cuckoo Filter: membership
|
|
170
|
+
-- Cuckoo Filter: membership testing with deletion (unlike Bloom filters)
|
|
178
171
|
CREATE FILTER active_sessions CAPACITY 500000
|
|
179
172
|
FILTER ADD active_sessions 'session_abc'
|
|
180
173
|
FILTER CHECK active_sessions 'session_abc'
|
|
@@ -183,18 +176,18 @@ FILTER DELETE active_sessions 'session_abc'
|
|
|
183
176
|
|
|
184
177
|
---
|
|
185
178
|
|
|
186
|
-
##
|
|
179
|
+
## Advanced Indexes
|
|
187
180
|
|
|
188
|
-
Beyond B-tree.
|
|
181
|
+
Beyond B-tree. Create the right index for your workload.
|
|
189
182
|
|
|
190
183
|
```sql
|
|
191
|
-
-- Hash: O(1) exact-match lookups
|
|
184
|
+
-- Hash index: O(1) exact-match lookups
|
|
192
185
|
CREATE INDEX idx_email ON users (email) USING HASH
|
|
193
186
|
|
|
194
|
-
-- Bitmap: analytical queries on low-cardinality columns
|
|
187
|
+
-- Bitmap index: fast analytical queries on low-cardinality columns
|
|
195
188
|
CREATE INDEX idx_status ON orders (status) USING BITMAP
|
|
196
189
|
|
|
197
|
-
-- R-Tree: spatial
|
|
190
|
+
-- R-Tree: spatial queries on geo data
|
|
198
191
|
CREATE INDEX idx_loc ON sites (location) USING RTREE
|
|
199
192
|
SEARCH SPATIAL RADIUS 48.8566 2.3522 10.0 COLLECTION sites COLUMN location LIMIT 50
|
|
200
193
|
SEARCH SPATIAL NEAREST 48.8566 2.3522 K 5 COLLECTION sites COLUMN location
|
|
@@ -202,7 +195,7 @@ SEARCH SPATIAL NEAREST 48.8566 2.3522 K 5 COLLECTION sites COLUMN location
|
|
|
202
195
|
|
|
203
196
|
---
|
|
204
197
|
|
|
205
|
-
##
|
|
198
|
+
## SQL Extensions
|
|
206
199
|
|
|
207
200
|
RedDB extends SQL with `WITH` clauses for operational semantics:
|
|
208
201
|
|
|
@@ -225,7 +218,7 @@ INSERT INTO events (name) VALUES ('launch') WITH EXPIRES AT 1735689600000
|
|
|
225
218
|
|
|
226
219
|
---
|
|
227
220
|
|
|
228
|
-
##
|
|
221
|
+
## 6 Query Languages
|
|
229
222
|
|
|
230
223
|
Write in whatever you think in. The engine auto-detects the language.
|
|
231
224
|
|
|
@@ -242,9 +235,9 @@ All six hit the same engine, same data, same indexes.
|
|
|
242
235
|
|
|
243
236
|
---
|
|
244
237
|
|
|
245
|
-
##
|
|
238
|
+
## Native Migrations โ No External Tools
|
|
246
239
|
|
|
247
|
-
Stop reaching for Flyway, Liquibase, Drizzle Migrate, or Sequelize. RedDB handles schema and data migrations as first-class SQL commands
|
|
240
|
+
Stop reaching for Flyway, Liquibase, Drizzle Migrate, or Sequelize migrations. RedDB handles schema and data migrations as first-class SQL commands.
|
|
248
241
|
|
|
249
242
|
```sql
|
|
250
243
|
-- Register a migration
|
|
@@ -275,26 +268,26 @@ Every applied migration creates a **VCS commit** (RedDB's "Git for Data"). Rollb
|
|
|
275
268
|
|
|
276
269
|
---
|
|
277
270
|
|
|
278
|
-
##
|
|
271
|
+
## 48 Built-in Types
|
|
272
|
+
|
|
273
|
+
Not just `TEXT` and `INTEGER`. RedDB understands your domain.
|
|
279
274
|
|
|
280
|
-
|
|
275
|
+
**Network:** `IpAddr`, `Ipv4`, `Ipv6`, `MacAddr`, `Cidr`, `Subnet`, `Port`
|
|
276
|
+
**Geo:** `Latitude`, `Longitude`, `GeoPoint`
|
|
277
|
+
**Locale:** `Country2`, `Country3`, `Lang2`, `Lang5`, `Currency`
|
|
278
|
+
**Identity:** `Uuid`, `Email`, `Url`, `Phone`, `Semver`
|
|
279
|
+
**Visual:** `Color`, `ColorAlpha`
|
|
280
|
+
**Cross-model refs:** `NodeRef`, `EdgeRef`, `VectorRef`, `RowRef`, `KeyRef`, `DocRef`, `TableRef`, `PageRef`
|
|
281
|
+
**Primitives:** `Integer`, `UnsignedInteger`, `Float`, `Decimal`, `BigInt`, `Text`, `Blob`, `Boolean`, `Json`, `Array`, `Enum`
|
|
282
|
+
**Temporal:** `Timestamp`, `TimestampMs`, `Date`, `Time`, `Duration`
|
|
281
283
|
|
|
282
|
-
|
|
283
|
-
|:---------|:------|
|
|
284
|
-
| **Network** | `IpAddr`, `Ipv4`, `Ipv6`, `MacAddr`, `Cidr`, `Subnet`, `Port` |
|
|
285
|
-
| **Geographic** | `Latitude`, `Longitude`, `GeoPoint` |
|
|
286
|
-
| **Locale** | `Country2`, `Country3`, `Lang2`, `Lang5`, `Currency` |
|
|
287
|
-
| **Identity** | `Uuid`, `Email`, `Url`, `Phone`, `Semver` |
|
|
288
|
-
| **Visual** | `Color`, `ColorAlpha` |
|
|
289
|
-
| **Cross-model Refs** | `NodeRef`, `EdgeRef`, `VectorRef`, `RowRef`, `KeyRef`, `DocRef`, `TableRef`, `PageRef` |
|
|
290
|
-
| **Primitives** | `Integer`, `UnsignedInteger`, `Float`, `Decimal`, `BigInt`, `Text`, `Blob`, `Boolean`, `Json`, `Array`, `Enum` |
|
|
291
|
-
| **Temporal** | `Timestamp`, `TimestampMs`, `Date`, `Time`, `Duration` |
|
|
284
|
+
Validation on write. No parsing in your app.
|
|
292
285
|
|
|
293
286
|
---
|
|
294
287
|
|
|
295
|
-
##
|
|
288
|
+
## Backup & Recovery
|
|
296
289
|
|
|
297
|
-
Built-in backup scheduler, WAL archiving, CDC, and Point-in-Time Recovery
|
|
290
|
+
Built-in backup scheduler, WAL archiving, Change Data Capture (CDC), and Point-in-Time Recovery framework:
|
|
298
291
|
|
|
299
292
|
```bash
|
|
300
293
|
# Poll real-time changes
|
|
@@ -315,7 +308,7 @@ PITR rollback, replica promotion), see
|
|
|
315
308
|
|
|
316
309
|
---
|
|
317
310
|
|
|
318
|
-
##
|
|
311
|
+
## KV REST API
|
|
319
312
|
|
|
320
313
|
Every collection doubles as a key-value store with dedicated REST endpoints:
|
|
321
314
|
|
|
@@ -348,26 +341,32 @@ SHOW CONFIG red.ai
|
|
|
348
341
|
|
|
349
342
|
---
|
|
350
343
|
|
|
351
|
-
##
|
|
344
|
+
## 3 Deployment Modes
|
|
352
345
|
|
|
353
|
-
| Mode |
|
|
354
|
-
|
|
355
|
-
| **Embedded** | SQLite | Rust API
|
|
356
|
-
| **Server** | Postgres | RedWire + gRPC + HTTP
|
|
357
|
-
| **Agent** | MCP
|
|
346
|
+
| Mode | Think of it as... | Access via |
|
|
347
|
+
|:-----|:-------------------|:-----------|
|
|
348
|
+
| **Embedded** | SQLite | Rust API -- `RedDB::open("data.rdb")` |
|
|
349
|
+
| **Server** | Postgres | RedWire + gRPC + HTTP listeners |
|
|
350
|
+
| **Agent** | MCP tool | `red mcp` -- AI agent integration |
|
|
358
351
|
|
|
359
|
-
Same storage format. Start embedded, scale to server, expose to agents
|
|
352
|
+
Same storage format across all three. Start embedded, scale to server, expose to agents -- no migration.
|
|
360
353
|
|
|
361
354
|
---
|
|
362
355
|
|
|
363
|
-
##
|
|
356
|
+
## Performance
|
|
364
357
|
|
|
365
|
-
> **Where RedDB wins
|
|
358
|
+
> **Where RedDB wins.** Two scenarios in the canonical `duel-official`
|
|
359
|
+
> benchmark show measurable wins over Postgres and Mongo today:
|
|
366
360
|
>
|
|
367
|
-
> - `typed_insert` โ **16ร faster** than PostgreSQL on typed
|
|
368
|
-
>
|
|
361
|
+
> - `typed_insert` โ RedDB โ **16ร faster** than PostgreSQL on typed
|
|
362
|
+
> single-row inserts.
|
|
363
|
+
> - `disk_usage` โ RedDB โ **1.5ร faster** than MongoDB on the
|
|
364
|
+
> compact-write path.
|
|
369
365
|
>
|
|
370
|
-
> See [`docs/perf/wins.md`](docs/perf/wins.md) for
|
|
366
|
+
> See [`docs/perf/wins.md`](docs/perf/wins.md) for the cited sessions
|
|
367
|
+
> and reproducible commands. The honest counterpart โ gaps where RedDB
|
|
368
|
+
> is still behind โ lives at
|
|
369
|
+
> [`docs/perf/when-not-reddb.md`](docs/perf/when-not-reddb.md).
|
|
371
370
|
|
|
372
371
|
RedDB uses multiple optimization techniques for fast queries at scale:
|
|
373
372
|
|
|
@@ -387,23 +386,25 @@ RedDB uses multiple optimization techniques for fast queries at scale:
|
|
|
387
386
|
|
|
388
387
|
---
|
|
389
388
|
|
|
390
|
-
##
|
|
389
|
+
## Durability & Corruption Defense
|
|
391
390
|
|
|
392
|
-
|
|
391
|
+
RedDB uses 7 layers of protection to keep your data safe:
|
|
393
392
|
|
|
394
|
-
| Layer |
|
|
395
|
-
|
|
396
|
-
| **File Lock** | Exclusive `flock`
|
|
397
|
-
| **Double-Write Buffer** | Pages
|
|
398
|
-
| **Header Shadow** |
|
|
399
|
-
| **Metadata Shadow** |
|
|
400
|
-
| **fsync Discipline** | `sync_all()`
|
|
401
|
-
| **Two-Phase Checkpoint** | WALโDB with `checkpoint_in_progress` flag
|
|
402
|
-
| **CRC32
|
|
393
|
+
| Layer | What it does |
|
|
394
|
+
|:------|:-------------|
|
|
395
|
+
| **File Lock** | Exclusive `flock` prevents two processes from writing the same `.rdb` file |
|
|
396
|
+
| **Double-Write Buffer** | Pages written to `.rdb-dwb` first; survives torn writes on power loss |
|
|
397
|
+
| **Header Shadow** | Copy of page 0 in `.rdb-hdr`; auto-recovers if header corrupts |
|
|
398
|
+
| **Metadata Shadow** | Copy of page 1 in `.rdb-meta`; auto-recovers collection registry |
|
|
399
|
+
| **fsync Discipline** | All critical writes followed by `sync_all()` (not just flush) |
|
|
400
|
+
| **Two-Phase Checkpoint** | Crash-safe WALโDB transfer with `checkpoint_in_progress` flag |
|
|
401
|
+
| **Binary Store CRC32** | V3 files have CRC32 footer + atomic write-to-temp-then-rename |
|
|
402
|
+
|
|
403
|
+
Every page has a CRC32 checksum (verified on read). Every WAL record has a CRC32 checksum. The binary store format (V3) includes a full-file CRC32 footer.
|
|
403
404
|
|
|
404
405
|
---
|
|
405
406
|
|
|
406
|
-
##
|
|
407
|
+
## Eventual Consistency
|
|
407
408
|
|
|
408
409
|
RedDB supports per-field eventual consistency via an append-only transaction log with periodic consolidation. Inspired by CRDT principles (commutative, associative reducers), it enables high-throughput write patterns while guaranteeing convergence.
|
|
409
410
|
|
|
@@ -428,7 +429,7 @@ See the [Eventual Consistency Guide](https://reddb-io.github.io/reddb/#/guides/e
|
|
|
428
429
|
|
|
429
430
|
---
|
|
430
431
|
|
|
431
|
-
##
|
|
432
|
+
## Geographic Operations
|
|
432
433
|
|
|
433
434
|
Built-in geo functions with no external dependencies. Supports both spherical (Haversine) and ellipsoidal (Vincenty/WGS-84) models.
|
|
434
435
|
|
|
@@ -461,7 +462,7 @@ Also available: destination point, bounding box, polygon area, spatial search (R
|
|
|
461
462
|
|
|
462
463
|
---
|
|
463
464
|
|
|
464
|
-
##
|
|
465
|
+
## Vector Clustering
|
|
465
466
|
|
|
466
467
|
Standalone K-Means and DBSCAN clustering on vector collections, with SIMD-accelerated distance computation and automatic parallelization.
|
|
467
468
|
|
|
@@ -481,9 +482,11 @@ K-Means uses parallel assignment (multi-threaded for datasets > 1K vectors). DBS
|
|
|
481
482
|
|
|
482
483
|
---
|
|
483
484
|
|
|
484
|
-
##
|
|
485
|
+
## Native Drivers
|
|
485
486
|
|
|
486
|
-
One connection-string API,
|
|
487
|
+
One connection-string API, four languages. Every driver accepts the same
|
|
488
|
+
`connect(uri)` contract so application code ports across runtimes with zero
|
|
489
|
+
ceremony.
|
|
487
490
|
|
|
488
491
|
| Language | Package | Install | Backends |
|
|
489
492
|
|-------------------|------------------|--------------------------------|-------------------------------------|
|
|
@@ -564,87 +567,74 @@ npx @reddb-io/cli@latest server --wire-bind 127.0.0.1:5050 --http-bind 127.0.0.1
|
|
|
564
567
|
|
|
565
568
|
---
|
|
566
569
|
|
|
567
|
-
##
|
|
568
|
-
|
|
569
|
-
**Install the `red` binary:**
|
|
570
|
+
## Quick Start
|
|
570
571
|
|
|
571
572
|
```bash
|
|
573
|
+
# Install
|
|
572
574
|
curl -fsSL https://raw.githubusercontent.com/reddb-io/reddb/main/install.sh | bash
|
|
573
|
-
#
|
|
574
|
-
```
|
|
575
|
+
# The installer verifies the selected release asset against SHA256SUMS before install.
|
|
575
576
|
|
|
576
|
-
|
|
577
|
+
# Start the server (wire: 5050, gRPC: 55055, HTTP: 5000)
|
|
578
|
+
red server --wire-bind 127.0.0.1:5050 --grpc-bind 127.0.0.1:55055 --http-bind 127.0.0.1:5000 --path ./data.rdb
|
|
577
579
|
|
|
578
|
-
|
|
579
|
-
red server --wire-bind 127.0.0.1:5050 --http-bind 127.0.0.1:5000 --path ./data.rdb
|
|
580
|
-
# RedWire: 5050 ยท gRPC: 55055 ยท HTTP: 5000
|
|
581
|
-
```
|
|
582
|
-
|
|
583
|
-
**Insert and query via HTTP:**
|
|
584
|
-
|
|
585
|
-
```bash
|
|
580
|
+
# Insert data
|
|
586
581
|
curl -X POST http://127.0.0.1:5000/query \
|
|
587
582
|
-H 'content-type: application/json' \
|
|
588
|
-
-d '{"query":"INSERT INTO hosts (ip, os) VALUES ('
|
|
583
|
+
-d '{"query":"INSERT INTO hosts (ip, os) VALUES ('\''10.0.0.1'\'', '\''linux'\'')"}'
|
|
589
584
|
|
|
585
|
+
# Query it
|
|
590
586
|
curl -X POST http://127.0.0.1:5000/query \
|
|
591
587
|
-H 'content-type: application/json' \
|
|
592
588
|
-d '{"query":"SELECT * FROM hosts"}'
|
|
593
589
|
```
|
|
594
590
|
|
|
595
|
-
|
|
591
|
+
Or via npm CLI launcher:
|
|
596
592
|
|
|
597
593
|
```bash
|
|
598
|
-
npx @reddb-io/cli@latest server --http-bind 127.0.0.1:5000
|
|
594
|
+
npx @reddb-io/cli@latest server --wire-bind 127.0.0.1:5050 --http-bind 127.0.0.1:5000
|
|
599
595
|
```
|
|
600
596
|
|
|
601
|
-
|
|
597
|
+
Or via Docker:
|
|
602
598
|
|
|
603
599
|
```bash
|
|
604
|
-
docker
|
|
605
|
-
|
|
600
|
+
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_USER" --password-stdin # if GHCR requires auth
|
|
601
|
+
docker run --rm -p 5050:5050 -p 55055:55055 -p 5000:5000 ghcr.io/reddb-io/reddb:latest
|
|
606
602
|
```
|
|
607
603
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
---
|
|
604
|
+
Or, if you only need the thin remote-only client (~7 MB image):
|
|
611
605
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
606
|
+
```bash
|
|
607
|
+
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_USER" --password-stdin # if GHCR requires auth
|
|
608
|
+
docker run --rm ghcr.io/reddb-io/reddb-client:latest red://reddb.example.com:5050 -c "SELECT 1"
|
|
609
|
+
```
|
|
615
610
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
| `reddb-io-engine` | Storage engine, indexes, query execution |
|
|
620
|
-
| `reddb-io-client` | Rust driver with embedded, gRPC, HTTP transports |
|
|
621
|
-
| `reddb-io-wire` | RedWire protocol vocabulary & framing |
|
|
622
|
-
| `reddb-io-rql` | RQL parser and semantic analyzer |
|
|
623
|
-
| `reddb-io-types` | Type system, value codec, cross-model refs |
|
|
611
|
+
For production-secure Docker (vault + secrets) and Kubernetes, see
|
|
612
|
+
[`docs/deployment/docker.md`](./docs/deployment/docker.md)
|
|
613
|
+
and [`docs/security/vault.md`](./docs/security/vault.md).
|
|
624
614
|
|
|
625
615
|
---
|
|
626
616
|
|
|
627
|
-
##
|
|
617
|
+
## Workspace layout
|
|
628
618
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
| ๐ [GitHub](https://github.com/reddb-io/reddb) | Source code, issues, discussions |
|
|
633
|
-
| ๐ฆ [npm CLI](https://www.npmjs.com/package/@reddb-io/cli) | Install & run via `npx` |
|
|
634
|
-
| ๐ค [npm Drivers](https://www.npmjs.com/package/@reddb-io/sdk) | Node/Bun/Deno SDK |
|
|
635
|
-
| ๐ [Release Notes](./docs/release-policy.md) | Version history & changelog |
|
|
636
|
-
| ๐ก๏ธ [Security Policy](./SECURITY.md) | Reporting vulnerabilities |
|
|
637
|
-
| โ
[Contract Matrix](./docs/reference/contract-matrix.md) | Every promise โ test or plan |
|
|
619
|
+
RedDB ships as a Cargo workspace. The `reddb` crate is the
|
|
620
|
+
umbrella that hosts the `red` binary; the engine, thin client,
|
|
621
|
+
gRPC stubs, and wire vocabulary live in sibling crates.
|
|
638
622
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
<div align="center">
|
|
623
|
+
## Links
|
|
642
624
|
|
|
643
|
-
|
|
625
|
+
- [Documentation](https://reddb-io.github.io/reddb)
|
|
626
|
+
- [GitHub](https://github.com/reddb-io/reddb)
|
|
627
|
+
- [npm driver package](https://www.npmjs.com/package/reddb)
|
|
628
|
+
- [npm CLI launcher](https://www.npmjs.com/package/@reddb-io/cli)
|
|
629
|
+
- [Releases](https://github.com/reddb-io/reddb/releases)
|
|
630
|
+
- [Release Policy](./docs/release-policy.md)
|
|
631
|
+
- [Support Policy](./SUPPORT.md)
|
|
632
|
+
- [Security Policy](./SECURITY.md)
|
|
633
|
+
- [Public Contract Matrix](./docs/reference/contract-matrix.md) โ every doc'd promise mapped to a test or a planned-status note
|
|
644
634
|
|
|
645
|
-
|
|
635
|
+
---
|
|
646
636
|
|
|
647
|
-
|
|
637
|
+
**Business Source License 1.1** -- source-available; free for self-hosted, internal, and non-production use. Offering RedDB as a managed/hosted database service to third parties requires a commercial license. Converts to AGPL-3.0 on 2030-06-22. See [LICENSE](./LICENSE). Built by [RedDB.io](https://github.com/reddb-io)
|
|
648
638
|
|
|
649
639
|
<!-- contract-matrix:begin -->
|
|
650
640
|
## Public-surface support
|
package/drivers/js/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reddb-io/sdk",
|
|
3
|
-
"version": "1.21.0
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Official embedded RedDB SDK โ launches a local red binary over stdio JSON-RPC. Use @reddb-io/client for remote HTTP, gRPC, and RedWire.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -57,7 +57,7 @@ export class DocumentClient {
|
|
|
57
57
|
.map(([field, value]) => `${sqlIdentifier(field)} = ${sqlValueLiteral(value)}`)
|
|
58
58
|
.join(', ')
|
|
59
59
|
const result = await this.db.query(
|
|
60
|
-
`UPDATE ${sqlIdentifierPath(collection)} SET ${assignments} WHERE rid = $1 RETURNING *`,
|
|
60
|
+
`UPDATE ${sqlIdentifierPath(collection)} DOCUMENTS SET ${assignments} WHERE rid = $1 RETURNING *`,
|
|
61
61
|
rid,
|
|
62
62
|
)
|
|
63
63
|
const item = result.rows?.[0]
|