{"id":20031761,"url":"https://github.com/astrodynamic/key-value-storage-redis-in-cpp","last_synced_at":"2026-02-16T00:02:52.492Z","repository":{"id":155833129,"uuid":"623775329","full_name":"Astrodynamic/Key-Value-Storage-Redis-in-CPP","owner":"Astrodynamic","description":"The project is a key-value store. The project uses data structures such as hash tables, self-balancing binary search trees, and B+ trees. The code is written in C++ with CMake as a build tool. It supports sanitization, testing, coverage, formatting, and static analysis.","archived":false,"fork":false,"pushed_at":"2023-05-09T08:29:45.000Z","size":1183,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-03T03:51:10.264Z","etag":null,"topics":["bd","bplustree","cmake","comand-line","console-application","cpp","cpp17","data-storage","database","hash-table","interface","key-value-store","makefile","memory-management","redis","storage"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Astrodynamic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-05T04:06:10.000Z","updated_at":"2024-11-06T11:51:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5cde292-733b-4382-91c0-0e68c6337618","html_url":"https://github.com/Astrodynamic/Key-Value-Storage-Redis-in-CPP","commit_stats":null,"previous_names":["astrodynamic/key-value-storage-redis-in-cpp","astrodynamic/redis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Astrodynamic/Key-Value-Storage-Redis-in-CPP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrodynamic%2FKey-Value-Storage-Redis-in-CPP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrodynamic%2FKey-Value-Storage-Redis-in-CPP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrodynamic%2FKey-Value-Storage-Redis-in-CPP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrodynamic%2FKey-Value-Storage-Redis-in-CPP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Astrodynamic","download_url":"https://codeload.github.com/Astrodynamic/Key-Value-Storage-Redis-in-CPP/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrodynamic%2FKey-Value-Storage-Redis-in-CPP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064222,"owners_count":25578997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bd","bplustree","cmake","comand-line","console-application","cpp","cpp17","data-storage","database","hash-table","interface","key-value-store","makefile","memory-management","redis","storage"],"created_at":"2024-11-13T09:34:37.791Z","updated_at":"2025-09-20T07:31:46.124Z","avatar_url":"https://github.com/Astrodynamic.png","language":"C++","readme":"# Key-Value Storage (Redis) in CPP\n\nRedis is a key-value store implemented in C++. The keys in the Redis store are strings, and the values are records of students with the following fields:\n- Last name\n- First name\n- Year of birth\n- City\n- Number of current coins\n\nThis README will help you understand how to build, use, and test the Redis key-value store.\n\n## Build\n\nThe project can be built using CMake version 3.15 or higher. To build Redis, follow these steps:\n1. Clone this repository.\n2. Navigate to the cloned directory.\n3. Run `cmake -S . -B ./build` command.\n4. Run `cmake --build ./build` command.\n\nYou can also build the individual libraries by running one of the following commands:\n- `make hash_table.a`: builds the Hash Table library.\n- `make self_balancing_binary_search_tree.a`: builds the Self Balancing Binary Search Tree library.\n- `make b_plus_tree.a`: builds the B+ Tree library.\n\n## Dependencies\n\nThe Redis key-value store depends on the following libraries:\n- BPlusTreeLibrary\n- HashTableLibrary\n- SelfBalancingBinarySearchTreeLibrary\n\n## Usage\n\nTo use the Redis key-value store, you can run the following commands:\n\n### SET\n\nThis command is used to set the key and its value. In the example below, the key is the string foo, and the value is the structure described above. The values of the new record fields are entered in the order they are described in the structure. EX is used as an optional parameter to specify the lifetime of the record you are creating. If the optional field is not specified, the record lifetime is not limited by default.\n```\nSET foo Vasilev Ivan 2000 Moscow 55 \n\u003e OK\nSET foo Vasilev 123 aaaaa Moscow 55 \n\u003e ERROR: unable to cast value \"aaaa\" to type int \n```\nAn example of using the SET command to create a record with a time limit. The record will exist for 10 seconds, and then it will be automatically deleted:\n```\nSET foo Vasilev Ivan 2000 Moscow 55 EX 10 \n\u003e OK\n```\n\n### GET\n\nThis command is used to get the value associated with the key. If there is no such record, (null) will be returned:\n```\nGET foo\n\u003e Vasilev Ivan 2000  Moscow   55 \nGET unknownkey\n\u003e (null)\n```\n\n### EXISTS\n\nThis command checks if a record with the given key exists. It returns true if the object exists or false if it doesn't:\n```\nEXISTS foo\n\u003e true\n```\n\n### DEL\n\nThis command deletes the key and the corresponding value, then returns true if the record was successfully deleted, otherwise false:\n```\nDEL foo\n\u003e true\n```\n\n### UPDATE\n\nThis command updates the value by the corresponding key if such a key exists:\n```\nSET foo Vas I 20 Mos 5 \n\u003e OK\nUPDATE foo Vasilev Ivan 2000 Moscow 55 \n\u003e OK\nGET foo\n\u003e Vasilev Ivan 2000 Moscow 55\n```\nIf there is a field that is not planned to change, it is replaced by a dash \"-\":\n```\nSET foo Vas I 20 Mos 5 \n\u003e OK\nUPDATE foo Vasilev - - - 55\n\u003e OK\nGET foo\n\u003e Vasilev I 20 Mos 55 \n```\n\n### KEYS\n\nReturns all the keys that are in the store:\n```\nKEYS\n1) boo\n2) foo\n3) bar\n```\n\n### RENAME\n\nThis command is used to rename keys:\n\n```\nRENAME foo foo2\n\u003e OK\n\nGET foo\n\u003e (null)\n\nGET foo2\n\u003e Vasilev I 20 Mos 55\n```\n\n### TTL\n\nWhen the key is set with the time limit, this command can be used to view the remaining time. If there is no record with\nthe given key, `(null)` will be returned:\n\n```\nSET Vasilev Ivan 2000 Moscow 55 EX\n10\n\u003e OK\nTTL foo\n\u003e 6\nTTL foo\n\u003e 5\nTTL foo\n\u003e 4\nTTL foo\n\u003e (null)\n```\n\n### FIND\n\nThis command is used to restore the key (or keys) according to a given value. Similarly to the `UPDATE` command, you\ndon’t have to specify all the values from the structure of the School 21 students. If any fields will not be searched,\nit is replaced by a dash \"-\".\n\nAn example of using the `FIND` command to search through all fields of a student structure:\n\n```\nFIND Vasilev Ivan 2000 Moscow 55 \n\u003e 1) foo\nFIND Vasilev Anton 1997 Tver 55\n\u003e 1) boo\n```\n\nAn example of using the `FIND` command to search by last name and number of coins:\n\n```\nFIND Vasilev - - - 55\n\u003e 1) foo\n\u003e 2) boo\n```\n\n### SHOWALL\n\nThis command is used for getting all records that are in the key-value store at the moment:\n\n```\nSHOWALL\n\u003e № | Last name |   First name   | Year |  City   | Number of coins |\n\u003e 1   \"Vasilev\"       \"Ivan\"       2000  \"Moscow\"         55 \n\u003e 2   \"Ivanov\"       \"Vasily\"      2000  \"Moscow\"         55 \n```\n\n### UPLOAD\n\nThis command is used to upload data from a file. The file contains a list of uploaded data in the format:\n\n```\nkey1 \"Vasilev\" \"Ivan\" 2001 \" Rostov\" 55\nkey2 \"Ivanov\" \"Vasiliy\" 2000 \"Москва\" 55 \n...\nkey101 \" Sidorov\" \"Sergei\" 1847 \"Suzdal\" 12312313 \n```\n\nCommand call:\n\n```\nUPLOAD ~/Desktop/TestData/file.dat\n\u003e OK 101\n```\n\nAfter the `OK` the number of strings uploaded from the file is displayed.\n\n### EXPORT\n\nThis command is used to export the data that are currently in the key-value store to a file. The output of the file must\ncontain a list of data in the format:\n\n```\nkey1 \"Vasilev\" \"Ivan\" 2001 \" Rostov\" 55\nkey2 \"Ivanov\" \"Vasiliy\" 2000 \"Москва\" 55 \n...\nkey101 \" Sidorov\" \"Sergei\" 1847 \"Suzdal\" 12312313 \n```\n\nCommand call:\n\n```\nEXPORT ~/Desktop/TestData/export.dat\n\u003e OK 101\n```\n\nAfter the `OK` the number of strings exported from the file is displayed.\n\n## License\n\nThis project is released under the [MIT license](LICENSE). You can find a copy of the MIT license in the LICENSE file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrodynamic%2Fkey-value-storage-redis-in-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrodynamic%2Fkey-value-storage-redis-in-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrodynamic%2Fkey-value-storage-redis-in-cpp/lists"}