A lightweight, file-based No-SQL database engine built from scratch in C, designed to handle key-value data with versioning support. Perfect for learning database internals or embedding into resource-constrained environments.
- Core Language: C (with
stdio.h
,stdlib.h
,string.h
) - Data Structures: Custom implementations of hash tables, linked lists, and dynamic arrays.
- Version Control: Column-level versioning for audit trails.
- Persistence: Logging operations to
log.txt
for durability. - Memory Management: Manual memory allocation/reallocation with optimizations for scalability.
- CRUD Operations:
create
,put
,get
,delete
tables and records. - Schema-less Design: Flexible key-value pairs with dynamic column support.
- Data Versioning: Track historical changes at the column level (e.g., see previous values of a field).
- Atomic Transactions: Commit updates safely with version consistency checks.
- Query Logging: All operations are logged to
log.txt
with timestamps. - Lightweight: No external dependencies—just compile and run!
- GCC compiler
- Basic terminal familiarity
- Clone the repo:
git clone https://github.com/JoeHitHard/No-SQL-DB.git cd No-SQL-DB/DB\ Engine
- Compile the code:
gcc main.c -o nosql_db
- Run the executable:
./nosql_db
create users;
Output: Table "users" has been created.
put users key=joe id=joe1 age=28 email=joe@dev.com;
Output: Row Inserted.
get users joe;
Output:
joe: id: joe1 Version: 1
age: 28 Version: 1
email: joe@dev.com Version: 1
delete users joe;
Output: Row Deleted.
get users all;
Output: Displays all rows in the users
table.
- Configuration Storage: Store app settings with version history.
- User Profiles: Manage flexible user attributes without rigid schemas.
- IoT Data Logging: Capture sensor readings with timestamps and versions.
- Educational Tool: Learn how databases handle CRUD and memory management.
- Add support for indexes to speed up queries.
- Implement a
rollback
command to revert to previous versions. - Add network support for remote connections.
- Support JSON export/import for interoperability.
⭐ Star this repo if you love minimalist, performant systems! ⭐