FreeDB

FreeDB is a in-memory database system that allows for the creation and management of tables with customizable column definitions. Each table enforces data type integrity, allowing for well-structured data storage and querying.

Features:

  • Create Tables:
    Define tables with column names and expected data types.
  • Data Type Enforcement:
    Ensures that inserted records conform to the specified data types.
  • Querying:
    Supports basic queries such as fetching rows, ordering by a column, and filtering rows based on conditions.
  • Thread Safety:
    Uses `Mutex` to ensure thread-safe operations for creating tables and inserting records.
  • Persistence:
    Save the database to a file and load it back with ease using Ruby's `Marshal` serialization.
  • Auto-Save and Auto-Load:
    Automatically saves the database at program exit and auto-loads any saved data when the application starts.

Planned Improvements:

  • Implement Indexing for Faster Queries:
    Add indexing to speed up `where` and `order_by` queries by maintaining a sorted order for indexed columns.
  • Add Transaction Support:
    Introduce transactions with `BEGIN`, `COMMIT`, and `ROLLBACK` to ensure atomic operations and consistency.
  • Support for Joins Between Tables:
    Allow combining rows from multiple tables based on related columns.
  • Add Schema Validation:
    Add schema validation with constraints like unique, not-null, and foreign keys to enforce data integrity.
  • Add Support for Foreign Keys:
    Enable foreign key constraints to maintain integrity between related tables.
  • Optimize Thread Management:
    Add thread pools for more efficient thread management.
  • Query Optimization and Caching:
    Implement query caching to store frequently used results and reduce database load on repetitive queries.
  • Add Backup and Restore Mechanism:
    Introduce a backup and restore feature with incremental backups or versioning for data recovery.
  • Implement ACID Compliance:
    Ensure atomicity, consistency, isolation, and durability (ACID) to improve data reliability and safety.
  • Enable Asynchronous Database Operations:
    Allow asynchronous database queries and inserts for improved performance in concurrent environments.
  • Event Logging and Auditing:
    Log database operations for auditing, tracking changes, and debugging.
  • Add Support for Data Encryption:
    Implement data encryption to ensure that sensitive information is secure in memory and on disk.
  • Add Query Language Support:
    Introduce a custom query language to enable more expressive and complex queries.