Skip to content

Latest commit

 

History

History
111 lines (72 loc) · 1.8 KB

File metadata and controls

111 lines (72 loc) · 1.8 KB

Nano

Nano is a persistent, secure, key-value store I built from scratch in python to understand how sockets, async i/o, and LSM Trees work

Usage

Clone the repository

$ git clone https://github.com/SujayKarpur/Nano.git
$ cd Nano

Set up and activate a python virtual environment

$ python3 -m venv venv
$ source venv/bin/activate

Installs and Permissions...

$ pip install -r requirements.txt
$ sudo chmod +x nano

Start the server

$ python -m server 

Open a new tab and run the client

$ ./nano

API

General


help
Displays help menu.

exit
Exits the session.


Database-Level Commands


LIST
Lists all databases.

CREATE <database>
Creates a database.

DROP <database>
Drops a database.

SHARE <username> <permission_level>
Grants another user permissions to read/write/share the selected database.

SELECT <database>
Selects a database.


Modify the Selected Database


GET <key>
Retrieves a value.

SET <key> <value>
Sets a key’s value.

DELETE <key>
Deletes a key.


I. Key Value Stores

key-value stores are the simplest kind of databases - they are just mappings from keys to values.

Nano implements a basic in-memory key-value store using python dictionaries that supports some simple operations:

Alt text

II. Networking

Alt text

III. Handling Multiple Clients

IV. Concurrent Client Handling

Alt text

V. Persistence

Alt text

VI. LSM Trees

VII. Security

VIII. Future Improvements


References