Coder Social home page Coder Social logo

kissdb's Introduction

KissDB

Keep It Simple, Stupid: Database Server

About

KissDB is a very simple key-value NoSQL database server built for small- to medium-scale data storage needs. It offers simultaneous connections, resource locking, and a RESTful API. It has a theoretically infinite database, table, and box size depending on available disk space, mitigating one of the main hassles of SQL databases. Its intended purpose is JSON storage, but any data can be stored.

Structure

The structure is as follows:

  • One KissDB server hosts an unlimited number of database objects.
  • One KissDB database object holds an unlimited number of table objects.
  • One KissDB table object holds an unlimited number of boxes.

A KissDB table object acts like a container of key-value pairs with the name of each box being a key and its contents being the value associated with it.

In this way, I could access the information of a given username using a request such as the one below:

GET /MyAppliation/Users/ldarling

Which might return:

{"success": true, "result": "{\"name\": \"Luke Darling\", \"email\": \"[email protected]\"}"}

Or, if the box doesn't exist:

{"success": false, "result": "Box does not exist."}

Security

The server will eventually implement authentication, but for the moment should be hidden behind a firewall blocking outside access to its bound port. Once authentication is implemented, it should still be proxied via HTTPS using nginx or a similar server. The server must never be placed in the root of an existing web server.

API

<Required>
[Optional]

Create a database

Header

POST /<database>

Body

N/A

Example Responses

{"success":true,"result":"Database successfully created."}

{"success":false,"result":"Database already exists."}


Create a table

Header

POST /<database>/<table>

Body

N/A

Example Responses

{"success":true,"result":"Table successfully created."}

{"success":false,"result":"Table already exists."}


Create a box and optionally initialize its content

Header

POST /<database>/<table>/<box>

Body

[content]

Example Responses

{"success":true,"result":"Box successfully created."}

{"success":false,"result":"Box already exists."}


Get a list of all databases on the server

Header

GET /

Body

N/A

Example Responses

{"success":true,"result":["MyApplication1","MyApplication2"]}

{"success":true,"result":[]}


Get a list of all tables in a given database

Header

GET /<database>

Body

N/A

Example Responses

{"success":true,"result":["Users","Themes"]}

{"success":true,"result":[]}


Get a list of all boxes in a given database's table

Header

GET /<database>/<table>

Body

N/A

Example Responses

{"success":true,"result":["ldarling","jdoe"]}

{"success":true,"result":[]}


Get the contents of a given box

Header

GET /<database>/<table>/<box>

Body

N/A

Example Responses

{"success":true,"result":"Hello, world!"}

{"success":true,"result":"{\"name\":\"Luke Darling\",\"email\":\"[email protected]\"}"}

{"success":false,"result":"Box does not exist."}


Update the contents of a given box

Header

PUT /<database>/<table>/<box>

Body

<content>

Example Responses

{"success":true,"result":"Box successfully updated."}


Delete all databases

Header

DELETE /

Body

N/A

Example Responses

{"success":true,"result":"All databases successfully deleted."}


Delete a given database

Header

DELETE /<database>

Body

N/A

Example Responses

{"success":true,"result":"Database successfully deleted."}


Delete a given database's given child table

Header

DELETE /<database>/<table>

Body

N/A

Example Responses

{"success":true,"result":"Table successfully deleted."}


Delete a given database's given child table's box

Header

DELETE /<database>/<table>/<box>

Body

N/A

Example Responses

{"success":true,"result":"Box successfully deleted."}

System Requirements

KissDB currently only works on Linux and has only been tested on Ubuntu. I will never create a Windows version, even though it would be very simple to make cross-compatible, simply because Windows is inferior and not worth wasting code on.

Disclaimer

This software is still in development and may never see a complete production-ready version. This is mainly an exercise for my own learning experience, but may find its way into being used in some of my smaller projects. If you have criticisms, please refrain from complaining to me, but instead place your corrections in the form of a commit. This is an open-source project, after all.

kissdb's People

Contributors

lukedarling avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.