Skip to content

Key-value in-memory DB that does not (yet) saves it state on restart. Fast though.

License

Notifications You must be signed in to change notification settings

shaman007/key-val

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

key-val

About

Simple server in C that sits at 8080 port, serves like in-memory key-value db. It has folowing commands:

  • "write key value" writes or overwrites key with value, saving timestamp
  • "add key value" writes key with value, saving timestamp, but not overwrites it
  • "update key value" overwrites key with value, saving timestamp, but not add it
  • "search key" searches value by the key
  • "dump index offset" dupms what is in table from index to offset, if there are buckets there. Just "dump" returns first INITIAL_CAPACITY indexes.
  • "wipe" drops everyting
  • "size" show amount of key-values pairs and current hash table reserved
  • "delete key" deletes the key
  • "quit" close the connection.

Data model

Hash table, that stores key, it's hash, value and creation timestamp in a buckets linked to the table row.

Known problems

  • if client don't read socket but spams commands, servers segfaults

About

Key-value in-memory DB that does not (yet) saves it state on restart. Fast though.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages