8000 GitHub - Moha-dotcom/File_Based_Database_Storage
[go: up one dir, main page]

Skip to content

Moha-dotcom/File_Based_Database_Storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—‚๏ธ File_Based_Database_Storage

File-Based Database System (FDBS)

A lightweight JSON-based database built entirely with Node.js and the Filesystem (fs) module โ€” no external database required.
Each record is stored as a JSON line in text files, allowing fast appends, indexed lookups, and simple querying.


๐Ÿš€ Features

  • Store and retrieve JSON objects directly from .db files

  • Supports CRUD operations (Create, Read, Update, Delete)

  • Uses fs.promises for modern asynchronous handling

  • Append-only logging for durability and simplicity

  • Query data using intuitive syntax like:

  • db.find({ name: "John" })

  • Lightweight and dependency-free โ€” perfect for small projects or prototypes

๐Ÿง  Tech Stack

  • Node.js
  • fs/promises
  • path
  • crypto (optional, for IDs or hashing)

Implement file-based product database with logging

  • Added Database class to handle product storage in a JSON file.
  • Implemented methods to add products, find products by ID, and retrieve all products.
  • Integrated pino logger for structured logging of operations and errors.
  • Ensured duplicate product IDs are not added and logged appropriate warnings.
  • Handled file read/write operations with error logging for robustness.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0