⥠OverDrive-DB Professional Edition
Ultra-fast, hybrid SQL+NoSQL database with Git-like versioning, ACID transactions, and tamper-proof security.
ð Why OverDrive-DB?
OverDrive-DB is a high-performance database engine built in pure Rust â combining the reliability of structured SQL, the speed of NoSQL JSON storage, and the safety of Git-like version control in one engine.
âĻ Core Pillars
| Feature | Description | |
|---|---|---|
| ð | Hybrid Model | SQL queries + flexible NoSQL JSON storage |
| ð | ACID Transactions | BEGIN/COMMIT/ROLLBACK/SAVEPOINT with 4 isolation levels |
| ð | Git-like Versioning | Every change is a commit â rollback any table to any point |
| ðĄïļ | Tamper-Proof | SHA-256 hash chains + CRC32 checksums on every page |
| ðïļ | Sub-Millisecond | Memory-mapped storage with zero-copy reads |
| ð | Enterprise Security | TLS 1.3, Argon2id auth, RBAC enforcement |
| ð | Secondary Indexes | BTree, Hash, and Unique indexes for fast lookups |
| ð | Referential Integrity | Foreign keys, unique constraints, NOT NULL checks |
ðĶ Quick Start
# 1. Initialize
overdrive-admin init --data-dir ./data --force
# 2. Set Credentials
$env:OVERDRIVE_ADMIN_USER = "admin"
$env:OVERDRIVE_ADMIN_PASS = "secure_password_123"
# 3. Start Server
overdrive-serve --data-dir ./data
# 4. Connect
overdrive -h 127.0.0.1 -p 6969 -u admin -w secure_password_123 --insecure
ð ïļ SQL Command Reference
DDL â Data Definition Language
;
USE mydb;
mydb;
SHOW DATABASES;
;
users;
SHOW TABLES;
DESCRIBE users; -- Schema + row count
-- Schema Evolution
users ADD COLUMN email;
users ADD COLUMN status DEFAULT 'active';
users DROP COLUMN temp_field;
users RENAME COLUMN old_name TO new_name;
Indexes
(email);
(username);
CREATE HASH INDEX idx_status ON users (status);
idx_email;
SHOW INDEXES ON users;
Constraints
ADD CONSTRAINT uq_email UNIQUE (users.email);
ADD CONSTRAINT fk_order_user FOREIGN KEY (orders.user_id) REFERENCES (users._id);
DROP CONSTRAINT uq_email;
SHOW CONSTRAINTS ON users;
DML â Data Manipulation Language
-- Insert
INSERT INTO users {"name": "Karthik", "age": 25, "role": "admin"}
-- Select
SELECT * FROM users;
SELECT name, age FROM users WHERE age > 21 ORDER BY name ASC LIMIT 10;
SELECT DISTINCT role FROM users;
-- Aggregation + GROUP BY
SELECT COUNT(*) FROM users;
SELECT AVG(age) FROM users;
SELECT SUM(salary) FROM employees WHERE dept = 'engineering';
SELECT MIN(age) FROM users;
SELECT MAX(salary) FROM employees;
SELECT COUNT(*) FROM orders GROUP BY status;
-- JOINs
SELECT * FROM orders INNER JOIN users ON orders.user_id = users._id;
SELECT * FROM orders LEFT JOIN users ON orders.user_id = users._id;
SELECT * FROM orders RIGHT JOIN users ON orders.user_id = users._id;
-- Update & Delete
UPDATE users SET {"role": "admin"} WHERE name = 'Karthik';
DELETE FROM users WHERE age < 18;
-- Full-Text Search
SEARCH 'Karthik';
WHERE Operators
| Operator | Example |
|---|---|
= |
WHERE name = 'Karthik' |
!= / <> |
WHERE status != 'inactive' |
> < >= <= |
WHERE age > 21 |
LIKE |
WHERE name LIKE '%arth%' |
AND |
WHERE age > 21 AND role = 'admin' |
OR |
WHERE dept = 'eng' OR dept = 'ops' |
DCL â Data Control Language
@ss123' ROLE readonly;
DROP USER analyst;
GRANT admin TO analyst;
REVOKE admin FROM analyst;
SHOW USERS;
TCL â Transaction Control Language
BEGIN; -- Read Committed (default)
BEGIN ISOLATION SERIALIZABLE; -- Specific isolation level
SAVEPOINT checkpoint1; -- Named savepoint
ROLLBACK TO checkpoint1; -- Revert to savepoint
COMMIT; -- Persist changes
ROLLBACK; -- Abort transaction
Isolation Levels: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE
Utility Commands
EXPLAIN SELECT * FROM users WHERE age > 21; -- Query plan
HISTORY; -- Commit history
VERIFY; -- Integrity check
ð Production Operations
-- Monitoring
SHOW STATUS; -- Prometheus-style metrics
SHOW HEALTH; -- Health check (status, uptime, error rate)
SHOW SLOW QUERIES; -- Slow query log (top 10)
-- Backup & Recovery
BACKUP DATABASE; -- Full compressed backup to ./backups/
CHECK DATABASE; -- Page validation + hash chain verification
-- Cache Management
SHOW CACHE; -- Cache hit/miss statistics
FLUSH CACHE; -- Clear query cache
-- Server Control
SHUTDOWN; -- Graceful shutdown (flush WAL â close connections)
ðïļ Architecture
Storage Engine
B+Tree with internal node splitting, size-aware page rebalancing, and Copy-on-Write (CoW). Branch nodes enable O(log n) lookups across multi-level trees. Tombstone-based deletion defers physical removal for consistency.
MVCC â Multi-Version Concurrency Control
The programmatic API exposes full transactional control:
use Database;
use IsolationLevel;
let mut db = create?;
// Transactional writes
let txn = db.begin_transaction?;
let id = db.insert_mvcc?;
db.commit_transaction?;
// Transactional reads (snapshot isolation)
let txn2 = db.begin_transaction?;
let record = db.get_mvcc?;
// Garbage collect old versions
db.gc_old_versions;
Secondary Indexes API
use ;
db.create_index?;
let results = db.query_by_index?;
db.drop_index;
Indexes are automatically updated on insert_json, update, and delete.
Concurrency Control
| Feature | Implementation |
|---|---|
| Row/Table Locking | Shared, Exclusive, Intent modes |
| Deadlock Detection | BFS on wait-for graph |
| Lock Timeouts | Configurable per-session |
| WAL | Disk-persisted, checksummed entries |
| Undo Log | Per-transaction rollback support |
| MVCC | Versioned reads with snapshot isolation |
Security Stack
| Layer | Technology |
|---|---|
| Transport | TLS 1.3 (auto-generated certs) |
| Authentication | Argon2id memory-hard hashing |
| Authorization | RBAC with GRANT/REVOKE |
| Data Integrity | SHA-256 hash chains + CRC32 |
| Sessions | Token binding + TLS pinning |
Query Engine
| Component | Capabilities |
|---|---|
| JoinExecutor | INNER, LEFT, RIGHT JOIN |
| Aggregator | COUNT, SUM, AVG, MIN, MAX + GROUP BY |
| Sorter | Multi-column ORDER BY with ASC/DESC |
| IndexManager | BTree, Hash, Unique index types |
| ConstraintManager | Unique, FK, NOT NULL, Check constraints |
| Optimizer | Cost-based with table statistics |
⥠SIMD Vectorization
use ;
// Batch filter: find all values > 100
let indices = filter_i64;
// Vectorized aggregation
let total = sum_i64;
let = min_max_i64.unwrap;
// Fast byte-pattern search (word-at-a-time)
let pos = contains_bytes;
ð Async I/O
use ;
let mut mgr = new?; // 4 worker threads
// Submit async page reads
let mut reader = new;
reader.submit_reads;
let pages = reader.collect_all; // Wait for completion
// Check I/O stats
let stats = mgr.stats;
println!;
mgr.shutdown;
ð Performance
| Action | Throughput |
|---|---|
| Reads (Mmap) | 200,000+ ops/sec |
| Writes (WAL) | 80,000+ ops/sec |
| Rollback | O(1) instant |
| Indexed Lookup | O(log n) |
| JOIN (1KÃ1K) | <10ms |
| SIMD Filter (10K) | <100Ξs |
ð Resources
- ð Full Documentation
- ð Security Architecture
- ð Deployment Guide
Built with âĪïļ in Rust ðĶ Professional Edition v0.2.0