• Stars
    star
    71
  • Rank 427,501 (Top 9 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 6 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

StringDB is a modular, key/value pair archival DB designed to consume *tiny* amounts of ram & produce *tiny* databases.

StringDB

StringDB

Build Status Test Status Nuget Version Nuget Downloads

Install-Package StringDB

Introduction

StringDB is a key/value pair store with a friendly API to use as little RAM and space as possible.

Verify the claims for yourself:

Api

Enumerate over a database and it's values, the fastest, by enumerating over it optimally

using var db = new DatabaseBuilder()
	.UseIODatabase(StringDBVersion.Latest, "database.db", out var optimalTokenSource)
	.WithBuffer(1000)
	.WithTranform(StringTransformation.Default, StringTransformation.Default);
	
foreach (var (key, value) in db.EnumerateOptimally(optimalTokenSource))
{
	// do something with the key and value
}

Use fluent extensions to create a database:

using IDatabase<string, string> db = new DatabaseBuilder()
    .UseIODatabase(StringDBVersion.Latest, "database.db")
    .WithBuffer(1000)
    .WithTransform(StringTransformation.Default, StringTransformation.Default);

using IDatabase<int, string> memDb = new DatabaseBuilder()
    .UseMemoryDatabase<int, string>();

Use the IDatabase interface to interface with databases

void InsertGreeting(IDatabase<string, string> database, string user)
{
    database.Insert(user, $"Greetings, {user}!");
}

And inherit BaseDatabase to create your own IDatabases with minimal effort

public class TestDatabase : BaseDatabase<int, string>
{
    private class LazyValue : ILazyLoader<string>
    {
        private readonly string _value;
        public LazyValue(int value) => _value = value.ToString();
        public string Load() => _value;
        public void Dispose() {}
    }
	
	public override void Dispose() {}

    protected override void InsertRange(KeyValuePair<int, string>[] items)
    {
        foreach(var item in items)
        {
            Console.WriteLine($"{item.Key}: {item.Value}");
        }
    }

    protected override IEnumerable<KeyValuePair<int, ILazyLoader<string>>> Evaluate()
    {
        for(var i = 0; i < int.MaxValue)
        {
            yield return KeyValuePair.Create(i, new LazyValue(i));
        }
    }
}

Tiny icon_tiny

StringDB is tiny. Use tiny amounts of RAM, and tiny amounts of space.

Chart

Inserts Size (in KB, 1000 bytes) Absolute Minimum Size Possible StringDB Overhead Percentage
1 1.172 KB 1.152 KB 1.706485%
50 58.208 KB 57.6 KB 1.04453%
100 116.408 KB 115.2 KB 1.037729%

This chart shows the size of a StringDB file after multiple single inserts. Every key is 128 bytes long, and every value is 1024 bytes long. By doing single inserts, file size is dramatically affected due to the additional overhead for the index chain.

Chart

Elements in Insert Range Size (in KB, 1000 bytes) Absolute Minimum Size Possible StringDB Overhead Percentage
1 1.172 KB 1.152 KB 1.706485%
50 57.963 KB 57.6 KB 0.626262%
100 115.913 KB 115.2 KB 0.615117%

This chart shows the size of a StringDB file after a single insert range with the amount of items specified.

Addons

Official addon support will be maintained for these libraries.

Issues welcomed!

Don't be afraid to make an issue about anything and everything!

  • Is there something weird with how databases are created? Submit an issue!
  • Is there something that you wish you could do but can't? Submit an issue!
  • Is this library not suitable for your purposes? Submit an isssue!
  • Want it to do something? Submit an issue!

It's an honour to have you use this library, and feedback is needed to make this the greatest it can be.

Need immediate assistence? Join the discord!

More Repositories

1

jssat

Compile JS into LLVM IR - JavaScript Static Analysis Tool
Rust
36
star
2

SwissILKnife

A "Swiss Army Knife" of sorts for IL-generated methods that are faster than their Expression & Reflection counterparts.
C#
12
star
3

smiley-face-game

TypeScript
8
star
4

denoporter

Tool to import typescript modules as deno modules.
TypeScript
8
star
5

opengl-tilemap

Implementation of an OpenGL tilemap as a single quad
Rust
7
star
6

Console.Abstractions

Simple, versatile, universal abstractions for the console, and bringing performance improvements to the table by minimizing as many console calls as possible.
C#
7
star
7

triggercd

TriggerCD is a commandline tool to make setting up continuous deployment a breeze.
Rust
5
star
8

Biind

Bind classes to interfaces, enabling more polymorphic inheritence and extensability of code you don't own, or making using legacy code slightly more enjoyable.
C#
4
star
9

cors-get-proxy

Simple CORS GET-only proxy, made with cloudflare workers.
JavaScript
3
star
10

pread

Perform atomic seek and read/write operations in C#. Named after "pread", a POSIX function for atomically seeking and reading.
C#
3
star
11

gpt2-with-training-wheels

A basic re-implementation of GPT-2 using PyTorch with some comments, to get myself more familiar with PyTorch and neural networks in general.
Python
2
star
12

VariableInjection

A lightweight, easy, fast property injection framework.
C#
2
star
13

BatFramework

BatFramework - The framework in batch to make life a little better.
Batchfile
1
star
14

sirjosh_overlay

Custom overlay for my gentoo ebuilds
Shell
1
star
15

rust-atlas-generator

An atlas generator written in Rust, compiled to Wasm, for Phaser 3.
JavaScript
1
star
16

message_bounce_benchmark

A simple Elixir application, made for the purpose of learning the language, that will spawn messages from one node to another as fast as it can.
Elixir
1
star
17

SeSet

A bot to instantly make a fast switch resetter.
C#
1
star
18

SwitchAsm

A low-level abstraction over the core basics of EE switches.
C#
1
star
19

tinkerlang

Tinkerlang is the prototyper's paradise; perfectly prepare prototype proglangs in a pinch.
Rust
1
star
20

PropertyHacker

Set & Get values of *any* auto property in C#.
C#
1
star
21

DBDownloader

Download stuff from PlayerIO's BigDB.
C#
1
star
22

SortingVisualizer

A sorting visualizer, made in C++, primarily made for the purpose of learning about the build tooling surrounding C++.
C++
1
star
23

SirJosh3917

Github README
1
star
24

BlockWorksClone

Block Works, but cloned so the community can revive it themselves.
C#
1
star
25

EMakesAlts

Everybody Makes Alts - The captcha cracker for PlayerIO
C#
1
star
26

dashlane_secure_export_demystifier

Rust tool to decrypt dashlane secure exports.
Rust
1
star
27

EEMiniClasses

My proposition to EE's inconsistency with 'b', 'br', 'bs', and the likes by making a class to handle it all, anything you want,
C#
1
star
28

Fireworks

ASCII Fireworks in C#
C#
1
star
29

narc

Narc allows users to report bad behavior, and provides top notch moderation tools for handling those reports.
Rust
1
star
30

DBCreator

Data Base Creator. You can use this to create a database with lots of stuff.
C#
1
star
31

PlugInIt

A simple way to add plugin functionality to your projects.
C#
1
star
32

OffEE

An Offline Client of EE, made in c#
C#
1
star
33

react-simple-events

Simple easy events for React that gets out of your way.
TypeScript
1
star
34

LanguageLookup

An easy, reflection based solution to the problem of using different strings for different languages.
C#
1
star
35

Old-EE-Documentation

Documentation on the protocol for Old EE
1
star
36

PlayerIOClient.Fluent

Fluently build PlayerIOClient code, and write less of it.
C#
1
star
37

FastLogin

Automatically login a bunch of accounts to PlayerIO with extreme haste.
C#
1
star
38

WorldModify

WorldModify is a modified version of the Classicube Client ( classicube.net ). It allows you to do cool world building type things.
C#
1
star
39

EEResourceExtractor

Extract every aura color, shape, smiley, brick package, and brick into a json file for usage in other applications.
C#
1
star
40

InlineIL

Write IL emissions directly in your code, without any need for Reflection.Emit
C#
1
star
41

Scarlet

Scarlet - Codename for the EE & EEU Minimap Viewer APIs found at api.sirjosh3917.com/ee & api.sirjosh3917.com/eeu
C#
1
star
42

WorldSaver

The format proposed by destroyer123 made into a C# library.
C#
1
star
43

VSXMLParser

Parse VS's XML documentation into markdown
C#
1
star
44

schedule-an-event

Source of scheduleanevent.com - Create countdowns to events, without friction.
HTML
1
star
45

SimpleShoppingListThing

a simple shopping thing in C# using EF Core while attempting at doing Onion architecture & EF correctly
C#
1
star
46

ephemeral-minigame-server

Prototype/basis of a Minecraft server that spawns ephemeral minigame servers
Rust
1
star
47

SirJoshSpeedyComputer

Kills all non-default processess in an effort to speed up computer performance considerably depending on the state of the computer.
C#
1
star
48

assuo

Some small CLI utility that behaves similar to `patch(1)`, built purely for hobbyist reasons.
Rust
1
star
49

kubernetes-client-server-example

An example project that has ephemeral pods in a kubernetes deployment talk to a kubernetes service which forwards the request to ephemeral server pods.
Shell
1
star
50

GoodWeb

GoodWeb is a simple (currently static) website generator with "reusable components" giving a react/vue feel.
Rust
1
star
51

BlockWorksAPI

A C# api for makign BlocksWorks blocks.
C#
1
star
52

CP

CP allows you to use low-end functions located in the kernal to do high-end functions for making extremely fast console games.
C#
1
star
53

EEApi

A C# wrapper for Lrussell's EE Api ( see ee.lrussell.net )
C#
1
star
54

send-message

Extremely minimal and simple CLI utility to securely send data using RSA.
Rust
1
star