A feature-complete, high-performance RDBMS with native AI/ML support, time-travel queries, adaptive compression, and enterprise securityβall in one unified engine.
Built from scratch in modern C++17, LatticeDB combines traditional database capabilities with cutting-edge features that major RDBMS don't provide natively out-of-the-box.
Full SQL parser with DDL, DML, DCL, TCL. JOINs (INNER, LEFT, RIGHT), GROUP BY, aggregates (COUNT, SUM, AVG, MIN, MAX), subqueries, and CTEs all fully implemented.
Built-in temporal support with FOR SYSTEM_TIME AS OF syntax.
Query historical data at any point in time with bitemporal architecture.
Fully implemented vector engine with Flat, HNSW, IVF algorithms and multiple distance metrics (L2, Cosine, Dot Product) for AI/ML workloads.
Row-level security, column encryption (AES-256-GCM, ChaCha20), authentication (password, JWT, certificates), and comprehensive audit logging.
Professional buffer pool manager with LRU/Clock replacement, B+ Tree indexes, Write-Ahead Logging (WAL), and ARIES recovery.
Full MVCC implementation with multiple isolation levels, 2PL protocol, deadlock detection, and savepoints for reliable transactions.
Working compression engine with RLE, Dictionary, Delta, Bit-packing, LZ4, and ZSTD algorithms for optimal storage efficiency.
Real-time continuous queries with windowing functions for streaming analytics and materialized views with backfill support.
LatticeDB provides features that major RDBMS generally don't offer natively, all unified in a single coherent engine.
| Capability | LatticeDB | PostgreSQL | MySQL | SQL Server |
|---|---|---|---|---|
| Full SQL with JOINs, GROUP BY | β Built-in | β Built-in | β Built-in | β Built-in |
| Time Travel (FOR SYSTEM_TIME) | β Built-in | Via extensions | Limited | Temporal tables |
| Native Vector Search | β Built-in | pgvector ext | Via plugins | Limited |
| Row-Level Security | β Built-in | β Built-in | Via views | β Built-in |
| Column Encryption | β Built-in | Via extensions | TDE only | Always Encrypted |
| Adaptive Compression | β Built-in | Basic | Basic | Advanced |
| Stream Processing | β Built-in | Via extensions | Via binlog | CDC |
| Custom Merge Policies (CRDTs) | β Built-in | Third-party | Third-party | Third-party |
| Built-in Web GUI | β Built-in | Third-party | Third-party | Third-party |
Modular, layered architecture with clear separation of concerns for extensibility and maintainability.
flowchart TD
subgraph "Client Layer"
GUI[Web GUI]
CLI[CLI Client]
SDK[SDKs]
end
subgraph "Query Engine"
PARSE[SQL Parser]
OPT[Query Optimizer]
EXEC[Executor]
end
subgraph "Storage Layer"
MVCC[MVCC Controller]
ULS[Universal Log Store]
IDX[B+ Tree & Vector Indexes]
end
subgraph "CRDT Engine"
LWW[LWW Register]
GSET[G-Set]
COUNTER[PN-Counter]
end
subgraph "Security & Privacy"
RLS[Row-Level Security]
DP[Differential Privacy]
AUDIT[Audit Logger]
end
GUI --> PARSE
CLI --> PARSE
SDK --> PARSE
PARSE --> OPT
OPT --> EXEC
EXEC --> MVCC
MVCC --> ULS
ULS --> IDX
EXEC --> RLS
EXEC --> DP
EXEC --> AUDIT
ULS --> LWW
ULS --> GSET
ULS --> COUNTER
Full SQL support with recursive descent parser, cost-based optimizer, and volcano-style execution.
MVCC with 2PL locking, multiple isolation levels, and automatic deadlock detection.
Multiple algorithms and distance metrics for efficient similarity search in high-dimensional spaces.
Get LatticeDB up and running in minutes
# Clone repository
git clone https://github.com/hoangsonww/LatticeDB-DBMS.git
cd LatticeDB-DBMS
# Build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
# Launch CLI
./latticedb
# Build Docker image
docker build -t latticedb .
# Run container
docker run -it --rm -v $(pwd)/data:/data latticedb
# Or use docker-compose
docker-compose up -d
# Start the database server
./build/latticedb_server
# In a new terminal, start the GUI
cd gui
npm install
npm run dev
# Open http://localhost:5173
The GUI includes SQL editor, schema browser, query history, and dark/light modes.
-- Create table
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(255) UNIQUE
);
-- Insert data
INSERT INTO users VALUES (1, 'Alice', 'alice@example.com');
-- Join query
SELECT u.name, COUNT(o.id) as order_count
FROM users u
INNER JOIN orders o ON u.id = o.user_id
GROUP BY u.id, u.name;
-- Time travel query
SELECT * FROM orders
FOR SYSTEM_TIME AS OF TX 5;
-- Vector search
SELECT * FROM embeddings
WHERE distance(vector, [0.1, 0.2, ...]) < 0.5
ORDER BY distance(vector, [0.1, 0.2, ...])
LIMIT 10;
Deploy to major cloud providers with built-in monitoring and observability
ECS Fargate with auto-scaling, EFS storage, and CloudWatch monitoring
cd aws && ./deploy.sh
Container Apps with serverless scaling and Azure Files integration
cd azure && ./deploy.sh
Cloud Run with global load balancing and Cloud SQL
cd gcp && ./deploy.sh
Nomad orchestration with Consul service mesh and Vault secrets
cd hashicorp && ./deploy.sh
Request rates, response times, database performance
Real-time visualization and custom dashboards
PagerDuty, Slack, and email notifications
Jaeger and OpenTelemetry integration
Comprehensive guides and references
Installation, configuration, and first steps
System design, components, and internals
Complete SQL syntax and extensions
Authentication, authorization, and encryption
Optimization, indexing, and benchmarking
Production deployment and operations
Competitive performance on OLTP workloads
| Operation | LatticeDB | PostgreSQL | MySQL |
|---|---|---|---|
| Q1 (Scan+Aggregate) | 1.2s | 1.5s | 2.1s |
| Q3 (Join) | 2.1s | 2.3s | 3.2s |
| Q5 (5-way Join) | 3.2s | 3.5s | 4.8s |
| Insert 1M rows | 8.5s | 9.2s | 11.3s |
| Vector Search (1M, 768D) | <100ms | ~150ms | N/A |
Test Environment: AWS c5.4xlarge (16 vCPU, 32GB RAM), TPC-H SF-10 dataset
Note: Performance may vary based on workload, hardware, and configuration
Contribute, learn, and grow with LatticeDB
Help improve LatticeDB by contributing code, documentation, or bug reports
View on GitHub βLatticeDB is released under the MIT License. Free to use in commercial and personal projects.