A lightweight file-based database built from scratch in Golang, designed to provide efficient and concurrent CRUD (Create, Read, Update, Delete) operations with structured data persistence.
This project demonstrates low-level file handling, concurrency control, and robust logging in a clean, modular Go implementation.
- Supports Create, Read, Update, and Delete operations on structured records.
- Built with simplicity and performance in mind for local data persistence.
- Implements thread-safe operations using Go’s
sync.Mutex. - Prevents race conditions and ensures consistency in multi-threaded environments.
- Data is stored and retrieved in JSON format for human-readable and structured storage.
- Enables smooth encoding/decoding of data objects.
- Uses Go’s
osandpath/filepathlibraries for flexible file and directory management. - Supports automatic creation and cleanup of storage files.
- Integrated with the Lumber logging library for detailed, leveled logs.
- Improves observability and debugging of database operations.
- Language: Go (Golang)
- Concurrency: sync.Mutex
- Data Format: JSON
- File System: os, path/filepath
- Logging: Lumber
- Go 1.21 or higher
- Git
git clone https://github.com/sarthak21-negi/go-database.git
cd go-database
go mod tidy