Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

levindb

A minimal in-memory TCP key-value database written in Go.

Features

  • Sharded In-Memory Storage: Uses 64 internal shards (sync.RWMutex) to minimize lock contention across concurrent requests.
  • Binary Wire Protocol: Lightweight binary protocol over TCP (localhost:2045).
  • Basic Operations: Supports Set (0), Get (1), and Delete (2).

Protocol

Requests start with a 9-byte header followed by key and value payloads:

+----------------+-------------------+---------------------+
| Type (1 byte)  | Key Size (4 byte) | Value Size (4 byte) |
+----------------+-------------------+---------------------+
| Key bytes (length = Key Size)                            |
+----------------------------------------------------------+
| Value bytes (length = Value Size)                        |
+----------------------------------------------------------+
  • Operations: 0 = SET, 1 = GET, 2 = DELETE
  • Endianness: Big-endian for length integers.

Quick Start

Build binaries:

go build -o bin/server ./cmd/server
go build -o bin/client ./cmd/client

Start the server:

./bin/server

Run the client:

./bin/client

Run tests:

go test ./...

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages