Skip to content

A lightweight and intuitive, in-memory, key-value store written in Go.

Notifications You must be signed in to change notification settings

sebastian-nunez/golang-key-value-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang key-value database (KVDB)

A lightweight and intuitive, in-memory, key-value store available through a TCP connection written in Go.

Features/API

  • SET: Store a key-value pair in the database, with an optional time-to-live (TTL) value (in Seconds).
    • Usage : SET <key> <value> <ttl>
  • GET: Retrieve the value associated with a given key from the database.
    • Usage: GET <key>
  • DELETE: Remove a key-value pair from the database.
    • Usage: DELETE <key>
  • PING: Health-check endpoint that responds with "PONG"
    • Usage: PING

Getting Started

To get started, follow these steps:

  1. Install Go version 1.23
  2. Clone the repository: git clone https://github.com/sebastian-nunez/golang-key-value-db
  3. Start database server: make run

Usage

Once the database server is up and running, you can interact with it using any tcp client like telnet or nc. Here are some examples:

$ nc localhost 3000
$ SET foo bar 300
$ OK ( Server Response )
$ GET foo
$ bar ( Server Response )

About

A lightweight and intuitive, in-memory, key-value store written in Go.

Topics

Resources

Stars

Watchers

Forks