Giter VIP home page Giter VIP logo

kvdb's Introduction

Overview

kvdb is an in-memory key-value store written in the Go programming language.

It uses a simple client-server model and is designed to be easy to use. It can be used as a database, session storage, or cache. It may not be suitable for complex needs.

Data is stored at keys of different types. You can store data ranging from basic string values to large objects.

Instances are easily configurable with environment variables and a simple YAML file.

Components:

  • kvdbserver - The server process
  • kvdb-cli - CLI tool to manage the server

Note! This project is in early development.

Data types

Currently supported data types:

  • String
  • HashMap

Documentation

Releases

Release notes are available here.

Binaries are available for download. Multiple platforms supported. You can download them here.

However, it is recommended to build the binaries from source. Instructions on how to build from source below.

Releases are managed with GoReleaser.

Build binaries

To build the binaries, you first need to install Go. Minimum version required is go1.22.

Instructions for installing Go can be found here.

You may also need tools to work with gRPC and Protocol Buffers in Go. This is needed if you want to compile .proto files and generate Go code.

If you just want to compile the binaries then installing only Go is enough.

After you have successfully installed go, clone this repository.

Cloning with git:

git clone https://github.com/hollowdll/kvdb.git

Note: You can also download the source code for a specific release here.

Change directory to the project root:

cd kvdb

Get the dependencies:

go mod tidy

Build the server:

go build -o ./bin/kvdbserver/ ./cmd/kvdbserver/

Build the CLI:

go build -o ./bin/kvdb-cli/ ./cmd/kvdb-cli/

These will build the binaries to bin/ directory in the project root. You can change the output directory and binary names to whatever you like by modifying the path with -o flag.

For more advanced build, use go help build to see more build options.

Docker

Images are available in Docker Hub with multiple tags. Links below.

Pull the server image

docker pull hakj/kvdb

Build the server image

Make sure to be in the project root

cd kvdb

Latest tag

docker build -f "./Dockerfile.bookworm" -t kvdb:latest .

Debian based image

docker build -f "./Dockerfile.bookworm" -t kvdb:bookworm .

Alpine Linux based image

docker build -f "./Dockerfile.alpine" -t kvdb:alpine .

These commands build the image only for a single architecture. If you want to build multi-arch images for other platforms, read this.

Start a container

Example of starting a container

docker run -p 12345:12345 --rm -it kvdb

This binds the host's port 12345 to the container's port 12345 so you can access the server outside the container.

Running tests

Change directory to the project root:

cd kvdb

Run all tests:

go test ./...

Run only integration tests:

go test ./tests/integration

Integration test environment variables

Integration test environment is configurable. Below is a list of environment variables that can be used when running integration tests.

  • KVDB_PORT: Test server TCP/IP port. Default port is 12345.
  • KVDB_HOST: Test server address. The test client will try to connect to this. Default address is localhost.

License

This project is licensed under MIT license. It is free and open source software.

kvdb's People

Contributors

hollowdll avatar

Watchers

 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.