SafinaDB (safina;سفينة;ship;saa-fee-na) is a custom-built database engine designed to be efficient, stable and fast (for learning purposes). Inspired by the Arabic word for "ship". This project is developed incrementally, starting from a basic key-value store to an advanced distributed database system.
- Data Storage: File-based storage for key-value pairs.
- Basic CRUD Operations: Create, Read, Update, Delete functionality.
- Simple CLI: Command-line interface for interacting with the database.
- In-Memory Data Structure: Add an in-memory hash map for faster access.
- Write-Through Cache: Implement caching with write-through to disk.
- Basic Indexing: Simple in-memory indexing for fast lookups.
- Log-based Storage: Implement write-ahead logging for durability.
- Recovery Mechanism: Add crash recovery to replay logs.
- Data Serialization: Efficient serialization and deserialization of data.
- B-Tree Indexes: Implement B-tree indexing for efficient range queries.
- Secondary Indexes: Add support for secondary indexes.
- Query Optimization: Basic query optimization techniques.
- Locking Mechanism: Implement basic locking for concurrent access.
- Transactions: Support for transactions with ACID properties.
- Isolation Levels: Implement different transaction isolation levels.
- Master-Slave Replication: Basic replication for high availability.
- Data Synchronization: Mechanism to sync data between nodes.
- Fault Tolerance: Basic fault tolerance and failover.
- Query Language: Implement a simple query language (e.g., SQL-like syntax).
- Stored Procedures: Support for stored procedures and functions.
- User Authentication: Basic user authentication and access control.
- Caching Strategies: Implement advanced caching strategies.
- Compression: Data compression for efficient storage.
- Performance Tuning: Optimize data structures and algorithms for performance.
- Sharding: Implement data sharding across multiple nodes.
- Consistency Protocols: Implement consistency protocols like Quorum or Paxos.
- Distributed Transactions: Support for distributed transactions and two-phase commit.
- Comprehensive Testing: Extensive testing for stability and performance.
- Documentation: Detailed documentation and user guides.
- Release: Finalize the release and publish as an open-source project.
To get started with SafinaDB, follow these steps:
-
Clone the repository:
git clone https://github.com/aallali/SafinaDB.git cd SafinaDB/safina_db
-
Build the project:
make build
-
Use the CLI:
make run
-
Run tests:
make test
-
Run benchmarks:
make bench
-
Generate documentation:
make doc