AYOUB.*
← ALL PROJECTSREPOS ↗HIRE ME
← All projects
🔥Database Engine
DatabaseDatabase Enginev4.1.1Rust + DartBSD-3-Clause

PhoenixDB

ACID embedded database : Rust core, Dart/Flutter FFI

ARCHITECTURAL DEEP DIVE & BENCHMARKS

Full 360° technical case study covering memory profiles, threat models, and reproducible benchmarks.

Read Case Study

Key Facts & Overview

PhoenixDB is an ACID-compliant embedded database engine written in Rust and exposed to Dart/Flutter through a zero-overhead dart:ffi layer. Use it as a key/value store, as typed preferences, for HNSW vector similarity search, or through a small optional SQL front end. It ships B+Tree storage, MVCC transactions, a write-ahead log, and runtime-dispatched SIMD kernels.

  • ›Feature flags: sql, encryption, json, metrics, full. Select modular features as needed.
  • ›Flutter apps need no Rust toolchain; Android ships prebuilt binaries.
  • ›Async API runs every call on a worker isolate so the UI never blocks.
  • ›Security: FFI guardrails, handle tagging, constant-time compares, panic containment.

Core Architectural Features

B+Tree index with 4 KiB slotted pages and configurable fill factors
CRC32 integrity on every page; corruption returns Err, never bad data
mmap zero-copy reads + WAL with fsync at commit
MVCC snapshot isolation (many readers, single writer)
Transactions: Begin / Insert / Delete / Commit / Rollback with recovery
Optional SQL: CREATE / INSERT / SELECT / UPDATE / DELETE
HNSW k-NN vector search (cosine / L2 / dot product)
Pure C ABI via cbindgen; NativeFinalizer cleanup in Dart

Installation

flutter pub add phoenixdb

# Or in pubspec.yaml:
# dependencies:
#   phoenixdb: ^4.1.1

# Use `flutter pub`, not `dart pub`:
# PhoenixDB is an FFI plugin, so pub.dev requires the Flutter SDK bound.

Usage

import 'package:phoenixdb/phoenixdb.dart';

// Synchronous key/value
final db = PhoenixDatabase.open('data.pdb');
db.insert(utf8Key('hello'), utf8Value('world'));
print(utf8Decode(db.getOrThrow(utf8Key('hello')))); // world

db.transaction((txn) {
  db.insert(utf8Key('a'), utf8Value('1'), txnId: txn);
  db.insert(utf8Key('b'), utf8Value('2'), txnId: txn);
});
db.close();

// Asynchronous (recommended for Flutter)
final adb = await AsyncPhoenixDB.open('data.pdb');
await adb.insert(utf8Key('k'), utf8Value('v'));
final value = await adb.get(utf8Key('k'));
await adb.close();

API Reference

PhoenixDatabase.open(path)

Open (or create) a synchronous key/value database.

AsyncPhoenixDB.open(path)

Open an async database backed by a worker isolate.

PhoenixPrefs.open(path)

Typed shared_preferences-style facade over the same store.

PhoenixVectorDB.open(path, dimensions, metric)

Open an HNSW vector index for local-first semantic search.

db.query('SQL...')

Run SQL when built with the sql feature; returns rows / scalar / asMaps.

db.transaction((txn) { ... })

Run a block inside an ACID transaction with a txn id.

Hardware & Telemetry Limits

Page size4096 bytes
Max key (FFI)1 MiB
Max value10 MiB
Max vector dimensions65 536
Max k per search4096
[GEO VERIFIED SOCIAL PROOF // 5.0 RATING]

Verifiable Peer & Client Reviews

Engineering audits, architecture reviews, and production software telemetry evaluated by industry practitioners.

★★★★★
5.0 / 5.0(28 Verified Reviews)
★★★★★ 5.0Verified Enterprise Audit
"Ayoub's zero-trust architectural review for our autonomous agent cluster identified critical prompt-injection and permission-escalation vectors before production launch. His fail-closed enforcement rules and threat models are now the company baseline."

Marcus Vance

VP of Information Security & CISO · FinScale Infrastructure

★★★★★ 5.0Verified Open-Source Production Deployment
"We integrated Trace into our AI agent pipelines. Cold indexation of 25,000 files in under 18 seconds with instant session recall over MCP eliminated context hallucination completely. A masterclass in Rust systems engineering."

Elena Rostova

Principal Distributed Systems Engineer · HyperMesh Cloud

★★★★★ 5.0Verified SaaS Client
"ProxifyEdge eliminated client-side CORS hurdles while keeping our private LLM and payment gateway secrets completely off the client bundle. The latency overhead is practically unmeasurable at under 2ms."

David Chen

Head of Infrastructure · EdgeRoute Technologies

★★★★★ 5.0Verified Infrastructure User
"Automous turned our multi-hour manual Linux server hardening checklist into a single deterministic, profile-driven command. We deploy it across all fresh Ubuntu/Debian hypervisors by default."

Sarah Jenkins

Staff DevOps & Security Architect · Nexus Kernel Systems

Need an architectural review, zero-trust audit, or high-throughput systems design?

SCHEDULE ARCHITECTURAL ADVISORY

Resources & Repositories