• Stars
    star
    159
  • Rank 235,881 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A minimalistic in-memory key value store.

Kiwi Logo

A minimalistic in-memory key value store.

Go CI Docs CI Docs CD PkgGoDev

Overview

You can think of Kiwi as thread safe global variables. This kind of library comes in helpful when you need to manage state across your application which can be mutated with multiple threads. Kiwi protects your keys with mutex locks so you don't have to.

Head over to kiwi.sdslabs.co for more details and documentation.

Installation

Kiwi requires Go >= 1.14

Kiwi can be integrated with your application just like any other go library.

go get -u github.com/sdslabs/kiwi

Now you can import kiwi any where in your code.

import "github.com/sdslabs/kiwi"

Basic usage

Create a store, add key and play with it. It's that easy!

store := stdkiwi.NewStore()

if err := store.AddKey("my_string", "str"); err != nil {
  // handle error
}

myString := store.Str("my_string")

if err := myString.Update("Hello, World!"); err != nil {
  // handle error
}

str, err := myString.Get()
if err != nil {
  // handle error
}

fmt.Println(str) // Hello, World!

Check out the tutorial to learn how to use Kiwi.

Benchmarks

Following are the benchmarks comparing Kiwi with BuntDB on a MacBook Pro (8th gen Intel i5 2.4GHz processor, 8GB RAM).

❯ go test -bench=. -test.benchmem ./benchmark
goos: darwin
goarch: amd64
pkg: github.com/sdslabs/kiwi/benchmark
BenchmarkBuntDB_Update-8        11777931                96.6 ns/op            48 B/op          1 allocs/op
BenchmarkBuntDB_View-8          23310963                47.1 ns/op            48 B/op          1 allocs/op
BenchmarkKiwi_Update-8          10356004               115 ns/op              48 B/op          3 allocs/op
BenchmarkKiwi_Get-8             21910110                53.2 ns/op             0 B/op          0 allocs/op
PASS
ok      github.com/sdslabs/kiwi/benchmark       6.216s

Following are the key differences due to which Kiwi is a little slow:

  1. BuntDB supports transactions, i.e., it locks the database once to apply all the operations (and this is what is tested).
  2. Kiwi supports dynamic data-types, which means, allocation on heap at runtime (interface{}) whereas BuntDB is statically typed.

The above two differences are what makes Kiwi unique and suitable to use on many occasions. Due to the aforementioned reasons, Kiwi can support typed values and not everything is just another "string".

There are places where we could improve more. Some performance issues also lie in the implementation of values. For example, when updating a string, not returning the updated string avoids an extra allocation.

Contributing

We are always open for contributions. If you find any feature missing, or just want to report a bug, feel free to open an issue and/or submit a pull request regarding the same.

For more information on contribution, check out our docs.

Contact

If you have a query regarding the product or just want to say hello then feel free to visit chat.sdslabs.co or drop a mail at [email protected]


Made by SDSLabs

More Repositories

1

gasper

Your Cloud in a Binary
Go
420
star
2

recommends

A collection of resources and reading material that we recommend
283
star
3

Rootex

An advanced C++ 3D game engine powering an in-production game yet to be announced
C++
215
star
4

Rubeus

A cross platform 2D game engine written in C++ for beginners
C++
182
star
5

zap-db

An easy to use JSON database written with ease of setup and memory management of slack bots in mind.
TypeScript
104
star
6

jinora

Slack webhook app to create anonymous public channels
CoffeeScript
88
star
7

hackview

webRTC based multi-person video chat with a collaborative editor.
JavaScript
84
star
8

beast

Jeopardy-style CTF challenge deployment and management tool.
Go
73
star
9

gut

A version control system with gut feeling.
Shell
59
star
10

playCTF

An Open Source CTF hosting platform
Vue
55
star
11

watchdog

πŸ”‘ Lightweight server access management system, written in Rust
Rust
43
star
12

quark

An open source framework to build competitive platforms
PHP
34
star
13

gsoc

Google Summer of Code: Ideas, Links, Proposals, etc.
HTML
31
star
14

jee

IIT-JEE Name wise Result
HTML
30
star
15

studyportal

The solutions portal of IITR
26
star
16

studyportal-nexus

Backend API for studyportal
Python
25
star
17

DSL

Run Ubuntu easily on macOS (Big Sur compatible)
Swift
24
star
18

phoenix

Redis based phantomjs queue
JavaScript
23
star
19

studyportal-axion

The ReactJS frontend for Study Portal
JavaScript
22
star
20

Problem-Statements

22
star
21

bot

Our personal chat-bot
CoffeeScript
22
star
22

codebot

CodeBot is an alternative terminal style interface for Project Euler.
PHP
21
star
23

play

β–Ί Internal Music Player @SDSLabs
JavaScript
21
star
24

makers-21

Makers 2021
20
star
25

gctl

Gasper on the command line. Deploy and manage applications and databases from the terminal.
Go
20
star
26

nano

A no distraction, minimal playlist player for SDSLabs' Muzi
JavaScript
19
star
27

Curvy

An addictive, multiplayer game in which one has to control a curve
JavaScript
18
star
28

gRoot

For when you need a friend with root access.
C#
18
star
29

makers

Makers tasks by SDSLabs.
17
star
30

forsit

A Cross Platform Problem Recommendation Engine
Python
17
star
31

slack-utils

Interact easily with the various slack APIs
CoffeeScript
15
star
32

slack-github

A webhook for GitHub that posts to your slack chat using an Incoming Webhook integration in slack.
JavaScript
14
star
33

portkey

File transfers using RTC over QUIC
Go
14
star
34

IITR-Shoot-Em-Up

A VR game where the player must shoot cannon balls at giant zombies to save the IITR Main Building
14
star
35

join

Our recruitment page
SCSS
13
star
36

katana

An advanced yet simple attack/defence CTF infrastructure in Go
Go
13
star
37

styleguide

Internal coding styleguide for SDSLabs.
12
star
38

portfolio

Portfolio repository for SDSLabs built with CSS & ❀️
JavaScript
11
star
39

team

SDSLabs team page
JavaScript
11
star
40

leaderboard

A leaderboard application to keep track of all social scores of a team
PHP
11
star
41

bruter

brute but stronger
Python
11
star
42

broCLI

A command line tool to streamline your game development process with Rubeus.
Go
11
star
43

redmine-to-gitlab

Scripts to import data from an existing redmine setup to gitlab
Python
10
star
44

slack-lens

A search backend for Slack using Elasticsearch and MySQL
Clojure
8
star
45

martie

Party Music management application for GDG New Delhi DevFest '13
JavaScript
8
star
46

rusticos

Rustic OS written completely in Rust
Rust
7
star
47

sdslabs.github.com

SDSLabs Blog
SCSS
7
star
48

gitlab-controller

Automates handling of SSH keys for Gitlab
Python
6
star
49

lectures

Lectures taken by SDSLabs
JavaScript
5
star
50

gbemu

A GameBoy emulator in C++
C++
5
star
51

codematics-problems

The problem repository for CodeBot. Please fork and add problems
5
star
52

muzi-scanner-old

Music Scanner for Muzi
Python
5
star
53

Echo-Backups

Java
4
star
54

git-lecture

Git Lecture @SDSLabs
4
star
55

botdb

Self hostable single JSON Bucket for our Bot
JavaScript
4
star
56

gasper-dockerfiles

Dockerfiles used in Gasper (https://github.com/sdslabs/gasper)
Dockerfile
3
star
57

game-portal

CSS
3
star
58

SDSLabs-Issue-Labeler

This is test repo for github bot
Python
3
star
59

data-mining-lectures

Repository of code/presentation used for Data Mining lectures
Python
3
star
60

muzi-scanner

Python
2
star
61

syntaxerror

Landing page for Syntax Error 2013
CSS
2
star
62

presence-3D

JavaScript
1
star
63

Onyx

Indexing Engine for ECHO Search Engine
Java
1
star
64

monopoly

Monopoly is web game based on IITR map
JavaScript
1
star
65

security

Our security disclosure policy
1
star
66

BOSCH-TRAFFIC-SIGN-RECOGNITION-frontend

The frontend electron app for BOSCH-TRAFFIC-SIGN-RECOGNITION project developed for Inter IIT
JavaScript
1
star
67

coming-soon

The coming-soon page of SDSLabs
JavaScript
1
star
68

Agent

Safe shutdown for servers.
1
star
69

watchdog-homepage

Website for the Watchdog tool
CSS
1
star
70

Gasper-API-Client

API Client for Gasper in javascript
JavaScript
1
star
71

data.sdslabs.co

Collection of schema for applications of SDSLabs
JavaScript
1
star
72

nymeria

Complete reimplementation of `Login` in Go using ory.sh in our applications.
Go
1
star
73

keyhouse-template

Python
1
star
74

enroute

https://enroute.sdslabs.co
JavaScript
1
star
75

katana-services

Python
1
star
76

Zeus

Lightning fast containers
1
star