Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shubhexists/go-json-db
A simple, light weight database using JSON, implemented in Go.
https://github.com/shubhexists/go-json-db
database db go golang json jsondb mongodb
Last synced: 3 months ago
JSON representation
A simple, light weight database using JSON, implemented in Go.
- Host: GitHub
- URL: https://github.com/shubhexists/go-json-db
- Owner: shubhexists
- License: mit
- Created: 2023-11-01T15:36:41.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-26T08:48:05.000Z (about 1 year ago)
- Last Synced: 2023-12-26T09:55:41.398Z (about 1 year ago)
- Topics: database, db, go, golang, json, jsondb, mongodb
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# go-json-db
This is a light weight, easily managable and beginner friendly implementation of a Database that anyone can implement directly in their Local Systems. It provides database API's to perform pretty much every operation that one can perform in a traditional database. The aim is to be a worthy contender in the choice of Database for small and medium use cases.```
_ _ _
__ _ ___ (_)___ ___ _ __ __| | |__
/ _` |/ _ \ _____| / __|/ _ \| '_ \ _____ / _` | '_ \
| (_| | (_) |_____| \__ \ (_) | | | |_____| (_| | |_) |
\__, |\___/ _/ |___/\___/|_| |_| \__,_|_.__/
|___/ |__/
```
# About
It goes down a No-Sql path ,quite similar to what MongoDB (Atlas) does. This project uses Directories to respresent any new collection and subsequent JSON files in their respective collections, each representing a record.The main idea of this project is to bring the complex database processes like caching and mutexes into the most understandable language of Developers i.e. JSON : ).
# Installation
Currently, to install, there are two dependencies that are also to be install with the project.
This package can be installed by -
```
go get github.com/shubhexists/go-json-db
```Cache is implemented by -
```
go get github.com/patrickmn/go-cache
```Logging is implemented by -
```
github.com/jcelliott/lumber
```
# Usage
1) Import the package by -```
github.com/shubhexists/go-json-db/models
```2) Create a new db instance in your desired directory -
```
db, cache, err := models.New("./database")
```3) Perform Operations as desired! For reference you can take the help of `examples/main.go` of this repository
# Status
This project was built by me as a part of learning Golang. This project is heavily insipred by the architecture that MongoDB takes to provide a database.This project still has lot of operations left which I would complete as soon as I get time , However as it's current stage, it is ready for usage in small projects atleast. : )
Enjoy!