Home
Bitemporal Database
Append-only immutable storage with MVCC snapshot reads, full SQL, LSM-tree engine, and embedded AI runtime. Built in Rust.
Why TensorDB?
Every write is an immutable fact. Every fact has a timeline. No data is ever lost, overwritten, or silently mutated.
Full SQL Surface
DDL, DML, JOINs, CTEs, window functions, aggregates, 60+ built-in functions. Real SQL — not a query DSL.
Learn more →Bitemporal by Default
Separate system time (when recorded) from business time (when valid). Time-travel with AS OF and VALID AT.
Learn more →Vector Search
Native vector similarity search with cosine, euclidean, and dot-product distance metrics. Build RAG pipelines in-database.
Learn more →Sub-Microsecond Performance
276ns point reads (4× faster than SQLite). 1.9µs point writes (20× faster). Direct shard bypass, lock-free fast path.
Learn more →LSM Storage Engine
WAL with CRC framing, skip-list memtable, prefix-compressed SSTables, bloom filters, LRU caches, multi-level compaction.
Learn more →Performance
Benchmarks run on Linux x86_64, single-threaded, 1M pre-loaded keys. Lower is better for all measurements. See full benchmarks.
Try TensorDB SQL
SELECT name, email, created_at
FROM users
WHERE status = 'active'
ORDER BY created_at DESC
LIMIT 5; | name | created_at | |
|---|---|---|
| Alice Chen | alice@example.com | 2025-03-15 09:22:01 |
| Bob Smith | bob@example.com | 2025-03-14 14:05:33 |
| Carol Wu | carol@example.com | 2025-03-14 08:47:19 |
| Dave Park | dave@example.com | 2025-03-13 22:11:45 |
| Eve Jones | eve@example.com | 2025-03-12 16:33:08 |
INSERT INTO transactions (id, account, amount, currency)
VALUES ('txn_001', 'acc_alice', 250.00, 'USD');
-- Every write becomes an immutable fact with:
-- commit_ts = auto-assigned system timestamp
-- valid_from = now (or specified)
-- valid_to = infinity | result |
|---|
| 1 row inserted (commit_ts: 1042) |
-- Read the database as it was at commit 500
SELECT account, balance
FROM accounts
AS OF 500
WHERE account = 'acc_alice'; | account | balance |
|---|---|
| acc_alice | 1,500.00 |
-- What was the policy rate valid on 2024-06-15?
SELECT policy_id, rate, valid_from, valid_to
FROM insurance_policies
VALID AT 1718409600
WHERE policy_id = 'POL-2024-001'; | policy_id | rate | valid_from | valid_to |
|---|---|---|---|
| POL-2024-001 | 4.25 | 1704067200 | 1735689600 |
SELECT u.name, COUNT(o.id) as order_count,
SUM(o.total) as total_spent
FROM users u
JOIN orders o ON u.id = o.user_id
GROUP BY u.name
HAVING total_spent > 100
ORDER BY total_spent DESC; | name | order_count | total_spent |
|---|---|---|
| Alice Chen | 12 | 2,450.00 |
| Bob Smith | 8 | 1,823.50 |
| Carol Wu | 5 | 967.25 |
EXPLAIN ANALYZE
SELECT * FROM orders
WHERE user_id = 'u_alice'
AND status = 'shipped'; | plan |
|---|
| Filter { predicate: status = 'shipped' } |
| └─ PointLookup { key: 'u_alice', cost: 1.00 } |
| execution_time_us: 42 |
| rows_returned: 3 |
| bloom_filter_hits: 1 |
| cache_hits: 2 |
Get Started
cargo add tensordbLicense: TensorDB is available under the PolyForm Noncommercial License 1.0.0. Free for personal, educational, and research use. Contact us for commercial licensing.