Code Monkey home page Code Monkey logo

smolkey's Introduction

Smolkey

Simple, Fast, In-Memory Key-Value store.

Features

  • In-memory store for very quick access
  • Basic Operations: PUT, GET, DELETE
  • Exposed via REST API

Potential Future Features:

  • REPL for interacting with the store
  • Metrics, accessible via the REPL

Running

git clone https://github.com/podikoglou/smolkey
cd smolkey
go run cmd/main.go

The Smolkey API is now running on port 8080.

Usage

curl

$ curl -X PUT -d value=bar http://localhost:8080/foo
Created

$ curl http://localhost:8080/foo
bar

Python (with requests)

import requests

requests.put("http://localhost:8080/foo", data={"value": "bar"})

response = requests.get("http://localhost:8080/foo")
print(response.text) # => bar

Benchmarks

All benchmarks were performed on an M1 Mac using wrk with 6 threads and 60 connections.

PUT

Writing Random Keys with Random Values:

  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    11.79ms   32.21ms 251.35ms   89.68%
    Req/Sec    36.05k    28.12k  159.33k    76.73%
  2030546 requests in 10.10s, 247.87MB read
Requests/sec: 201094.97
Transfer/sec:     24.55MB

GET

Reading Random Keys:

  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    12.28ms   32.68ms 269.33ms   89.47%
    Req/Sec    37.82k    30.49k  179.97k    75.25%
  2103317 requests in 10.05s, 243.71MB read
  Non-2xx or 3xx responses: 59431
Requests/sec: 209377.07
Transfer/sec:     24.26MB

Reading Specific Key:

  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    11.59ms   32.35ms 256.85ms   90.28%
    Req/Sec    46.51k    40.60k  209.97k    74.56%
  2626620 requests in 10.09s, 298.09MB read
Requests/sec: 260349.99
Transfer/sec:     29.55MB

Frequently Asked Questions

Why?

It's a toy project.

What about security?

Smolkey follows a philosophy similar to that of Redis. We trust you to run Smolkey under a firewall, so we really don't need to implement authentication in the application level. (if you really want authentication, you can theoretically proxy it through something like Caddy.)

smolkey's People

Contributors

podikoglou avatar

Watchers

Lucian avatar  avatar  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.