Skip to content

kvdb-api is the performance aware append only in-memory key-value store

Notifications You must be signed in to change notification settings

bilalislam/kvdb-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key-Value Rest Api

Table of contents

Installation

(Back to top)

To use this project, first clone the repo on your device using the command below:

git init

git clone /~https://github.com/bilalislam/kvdb-api

Usage

(Back to top)

build

$ cd kvdb
$ go build main.go -o kvdb-api
$ ./kvdb-api --help

help

You can print help following below;


  -async
        file sync for durability
  -interval int
        default every second (1s) (default 1)
  -maxRecordSize int
        max size of a database record (default 65536)
  -path string
        storage path (default "/tmp")
  -port int
        http server listening port (default 8080)

api start

$ ./kvdb-api

Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

http sample

$ curl -X POST -H "Content-Type: application/json" -d '{"foo":"bar"}' http://localhost:8080/foo
$ curl -X GET http://localhost:8080/foo

unit test

$ go test

Deployment

(Back to top)

docker compose for local build

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. To learn more about all the features of Compose, see the list of features

A docker-compose.yml looks like:


version: '3'

services:
  api:
    build:
      context: .
      dockerfile: tools/Dockerfile
    ports:
      - "8080:8080"

$ docker-compose up

Open http://localhost:8080 to view it in the browser.

References

(Back to top)

  1. https://redis.io/topics/persistence
  2. http://oldblog.antirez.com/post/redis-persistence-demystified.html
  3. https://tianpan.co/notes/174-designing-memcached
  4. https://blog.bytebytego.com/p/why-is-kafka-fast

About

kvdb-api is the performance aware append only in-memory key-value store

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages