{"id":13418092,"url":"https://github.com/valkey-io/valkey","last_synced_at":"2025-05-13T15:02:56.967Z","repository":{"id":229122103,"uuid":"775743011","full_name":"valkey-io/valkey","owner":"valkey-io","description":"A flexible distributed key-value database that is optimized for caching and other realtime workloads.","archived":false,"fork":false,"pushed_at":"2025-05-05T12:43:41.000Z","size":139225,"stargazers_count":21016,"open_issues_count":410,"forks_count":799,"subscribers_count":118,"default_branch":"unstable","last_synced_at":"2025-05-05T22:27:52.191Z","etag":null,"topics":["cache","database","key-value","key-value-store","nosql","redis","valkey","valkey-client"],"latest_commit_sha":null,"homepage":"https://valkey.io","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valkey-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-22T00:42:17.000Z","updated_at":"2025-05-05T22:21:05.000Z","dependencies_parsed_at":"2024-05-01T17:41:01.285Z","dependency_job_id":"62e55863-4cf3-44e7-aef9-5c9e3af74513","html_url":"https://github.com/valkey-io/valkey","commit_stats":{"total_commits":11159,"total_committers":871,"mean_commits":"12.811710677382319","dds":"0.49081458912088893","last_synced_commit":"9f8185f5c80bc98bdbc631b90ccf13929d6a0cbc"},"previous_names":["madolson/placeholderkv","valkey-io/valkey"],"tags_count":324,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valkey-io","download_url":"https://codeload.github.com/valkey-io/valkey/tar.gz/refs/heads/unstable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253968193,"owners_count":21992252,"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","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":["cache","database","key-value","key-value-store","nosql","redis","valkey","valkey-client"],"created_at":"2024-07-30T22:00:58.418Z","updated_at":"2025-05-13T15:02:56.960Z","avatar_url":"https://github.com/valkey-io.png","language":"C","readme":"[![codecov](https://codecov.io/gh/valkey-io/valkey/graph/badge.svg?token=KYYSJAYC5F)](https://codecov.io/gh/valkey-io/valkey)\n\nThis project was forked from the open source Redis project right before the transition to their new source available licenses.\n\nThis README is just a fast *quick start* document. More details can be found under [valkey.io](https://valkey.io/)\n\n# What is Valkey?\n\nValkey is a high-performance data structure server that primarily serves key/value workloads.\nIt supports a wide range of native structures and an extensible plugin system for adding new data structures and access patterns.\n\n# Building Valkey using `Makefile`\n\nValkey can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD.\nWe support big endian and little endian architectures, and both 32 bit\nand 64 bit systems.\n\nIt may compile on Solaris derived systems (for instance SmartOS) but our\nsupport for this platform is *best effort* and Valkey is not guaranteed to\nwork as well as in Linux, OSX, and \\*BSD.\n\nIt is as simple as:\n\n    % make\n\nTo build with TLS support, you'll need OpenSSL development libraries (e.g.\nlibssl-dev on Debian/Ubuntu).\n\nTo build TLS support as Valkey built-in:\n\n    % make BUILD_TLS=yes\n\nTo build TLS as Valkey module:\n\n    % make BUILD_TLS=module\n\nNote that sentinel mode does not support TLS module.\n\nTo build with experimental RDMA support you'll need RDMA development libraries\n(e.g. librdmacm-dev and libibverbs-dev on Debian/Ubuntu).\n\nTo build RDMA support as Valkey built-in:\n\n    % make BUILD_RDMA=yes\n\nTo build RDMA as Valkey module:\n\n    % make BUILD_RDMA=module\n\nTo build with systemd support, you'll need systemd development libraries (such\nas libsystemd-dev on Debian/Ubuntu or systemd-devel on CentOS) and run:\n\n    % make USE_SYSTEMD=yes\n\nTo append a suffix to Valkey program names, use:\n\n    % make PROG_SUFFIX=\"-alt\"\n\nYou can build a 32 bit Valkey binary using:\n\n    % make 32bit\n\nAfter building Valkey, it is a good idea to test it using:\n\n    % make test\n\nThe above runs the main integration tests. Additional tests are started using:\n\n    % make test-unit     # Unit tests\n    % make test-modules  # Tests of the module API\n    % make test-sentinel # Valkey Sentinel integration tests\n    % make test-cluster  # Valkey Cluster integration tests\n\nMore about running the integration tests can be found in\n[tests/README.md](tests/README.md) and for unit tests, see\n[src/unit/README.md](src/unit/README.md).\n\n## Fixing build problems with dependencies or cached build options\n\nValkey has some dependencies which are included in the `deps` directory.\n`make` does not automatically rebuild dependencies even if something in\nthe source code of dependencies changes.\n\nWhen you update the source code with `git pull` or when code inside the\ndependencies tree is modified in any other way, make sure to use the following\ncommand in order to really clean everything and rebuild from scratch:\n\n    % make distclean\n\nThis will clean: jemalloc, lua, libvalkey, linenoise and other dependencies.\n\nAlso if you force certain build options like 32bit target, no C compiler\noptimizations (for debugging purposes), and other similar build time options,\nthose options are cached indefinitely until you issue a `make distclean`\ncommand.\n\n## Fixing problems building 32 bit binaries\n\nIf after building Valkey with a 32 bit target you need to rebuild it\nwith a 64 bit target, or the other way around, you need to perform a\n`make distclean` in the root directory of the Valkey distribution.\n\nIn case of build errors when trying to build a 32 bit binary of Valkey, try\nthe following steps:\n\n* Install the package libc6-dev-i386 (also try g++-multilib).\n* Try using the following command line instead of `make 32bit`:\n  `make CFLAGS=\"-m32 -march=native\" LDFLAGS=\"-m32\"`\n\n## Allocator\n\nSelecting a non-default memory allocator when building Valkey is done by setting\nthe `MALLOC` environment variable. Valkey is compiled and linked against libc\nmalloc by default, with the exception of jemalloc being the default on Linux\nsystems. This default was picked because jemalloc has proven to have fewer\nfragmentation problems than libc malloc.\n\nTo force compiling against libc malloc, use:\n\n    % make MALLOC=libc\n\nTo compile against jemalloc on Mac OS X systems, use:\n\n    % make MALLOC=jemalloc\n\n## Monotonic clock\n\nBy default, Valkey will build using the POSIX clock_gettime function as the\nmonotonic clock source.  On most modern systems, the internal processor clock\ncan be used to improve performance.  Cautions can be found here:\n    http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/\n\nTo build with support for the processor's internal instruction clock, use:\n\n    % make CFLAGS=\"-DUSE_PROCESSOR_CLOCK\"\n\n## Verbose build\n\nValkey will build with a user-friendly colorized output by default.\nIf you want to see a more verbose output, use the following:\n\n    % make V=1\n\n# Running Valkey\n\nTo run Valkey with the default configuration, just type:\n\n    % cd src\n    % ./valkey-server\n\nIf you want to provide your valkey.conf, you have to run it using an additional\nparameter (the path of the configuration file):\n\n    % cd src\n    % ./valkey-server /path/to/valkey.conf\n\nIt is possible to alter the Valkey configuration by passing parameters directly\nas options using the command line. Examples:\n\n    % ./valkey-server --port 9999 --replicaof 127.0.0.1 6379\n    % ./valkey-server /etc/valkey/6379.conf --loglevel debug\n\nAll the options in valkey.conf are also supported as options using the command\nline, with exactly the same name.\n\n# Running Valkey with TLS:\n\n## Running manually\n\nTo manually run a Valkey server with TLS mode (assuming `./gen-test-certs.sh` was invoked so sample certificates/keys are available):\n\n* TLS built-in mode:\n    ```\n    ./src/valkey-server --tls-port 6379 --port 0 \\\n        --tls-cert-file ./tests/tls/valkey.crt \\\n        --tls-key-file ./tests/tls/valkey.key \\\n        --tls-ca-cert-file ./tests/tls/ca.crt\n    ```\n\n* TLS module mode:\n    ```\n    ./src/valkey-server --tls-port 6379 --port 0 \\\n        --tls-cert-file ./tests/tls/valkey.crt \\\n        --tls-key-file ./tests/tls/valkey.key \\\n        --tls-ca-cert-file ./tests/tls/ca.crt \\\n        --loadmodule src/valkey-tls.so\n    ```\n\nNote that you can disable TCP by specifying `--port 0` explicitly.\nIt's also possible to have both TCP and TLS available at the same time,\nbut you'll have to assign different ports.\n\nUse `valkey-cli` to connect to the Valkey server:\n```\n./src/valkey-cli --tls \\\n    --cert ./tests/tls/valkey.crt \\\n    --key ./tests/tls/valkey.key \\\n    --cacert ./tests/tls/ca.crt\n```\n\nSpecifying `--tls-replication yes` makes a replica connect to the primary.\n\nUsing `--tls-cluster yes` makes Valkey Cluster use TLS across nodes.\n\n# Running Valkey with RDMA:\n\nNote that Valkey Over RDMA is an experimental feature.\nIt may be changed or removed in any minor or major version.\nCurrently, it is only supported on Linux.\n\n* RDMA built-in mode:\n    ```\n    ./src/valkey-server --protected-mode no \\\n         --rdma-bind 192.168.122.100 --rdma-port 6379\n    ```\n\n* RDMA module mode:\n    ```\n    ./src/valkey-server --protected-mode no \\\n         --loadmodule src/valkey-rdma.so --rdma-bind 192.168.122.100 --rdma-port 6379\n    ```\n\nIt's possible to change bind address/port of RDMA by runtime command:\n\n    192.168.122.100:6379\u003e CONFIG SET rdma-port 6380\n\nIt's also possible to have both RDMA and TCP available, and there is no\nconflict of TCP(6379) and RDMA(6379), Ex:\n\n    % ./src/valkey-server --protected-mode no \\\n         --loadmodule src/valkey-rdma.so --rdma-bind 192.168.122.100 --rdma-port 6379 \\\n         --port 6379\n\nNote that the network card (192.168.122.100 of this example) should support\nRDMA. To test a server supports RDMA or not:\n\n    % rdma res show (a new version iproute2 package)\nOr:\n\n    % ibv_devices\n\n\n# Playing with Valkey\n\nYou can use valkey-cli to play with Valkey. Start a valkey-server instance,\nthen in another terminal try the following:\n\n    % cd src\n    % ./valkey-cli\n    valkey\u003e ping\n    PONG\n    valkey\u003e set foo bar\n    OK\n    valkey\u003e get foo\n    \"bar\"\n    valkey\u003e incr mycounter\n    (integer) 1\n    valkey\u003e incr mycounter\n    (integer) 2\n    valkey\u003e\n\n# Installing Valkey\n\nIn order to install Valkey binaries into /usr/local/bin, just use:\n\n    % make install\n\nYou can use `make PREFIX=/some/other/directory install` if you wish to use a\ndifferent destination.\n\n_Note_: For compatibility with Redis, we create symlinks from the Redis names (`redis-server`, `redis-cli`, etc.) to the Valkey binaries installed by `make install`.\nThe symlinks are created in same directory as the Valkey binaries.\nThe symlinks are removed when using `make uninstall`.\nThe creation of the symlinks can be skipped by setting the makefile variable `USE_REDIS_SYMLINKS=no`.\n\n`make install` will just install binaries in your system, but will not configure\ninit scripts and configuration files in the appropriate place. This is not\nneeded if you just want to play a bit with Valkey, but if you are installing\nit the proper way for a production system, we have a script that does this\nfor Ubuntu and Debian systems:\n\n    % cd utils\n    % ./install_server.sh\n\n_Note_: `install_server.sh` will not work on Mac OSX; it is built for Linux only.\n\nThe script will ask you a few questions and will setup everything you need\nto run Valkey properly as a background daemon that will start again on\nsystem reboots.\n\nYou'll be able to stop and start Valkey using the script named\n`/etc/init.d/valkey_\u003cportnumber\u003e`, for instance `/etc/init.d/valkey_6379`.\n\n# Building using `CMake`\n\nIn addition to the traditional `Makefile` build, Valkey supports an alternative, **experimental**, build system using `CMake`.\n\nTo build and install `Valkey`, in `Release` mode (an optimized build), type this into your terminal:\n\n```bash\nmkdir build-release\ncd $_\ncmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/valkey\nsudo make install\n# Valkey is now installed under /opt/valkey\n```\n\nOther options supported by Valkey's `CMake` build system:\n\n## Special build flags\n\n- `-DBUILD_TLS=\u003cyes|no\u003e` enable TLS build for Valkey. Default: `no`\n- `-DBUILD_RDMA=\u003cno|module\u003e` enable RDMA module build (only module mode supported). Default: `no`\n- `-DBUILD_MALLOC=\u003clibc|jemalloc|tcmalloc|tcmalloc_minimal\u003e` choose the allocator to use. Default on Linux: `jemalloc`, for other OS: `libc`\n- `-DBUILD_SANITIZER=\u003caddress|thread|undefined\u003e` build with address sanitizer enabled. Default: disabled (no sanitizer)\n- `-DBUILD_UNIT_TESTS=[yes|no]`  when set, the build will produce the executable `valkey-unit-tests`. Default: `no`\n- `-DBUILD_TEST_MODULES=[yes|no]`  when set, the build will include the modules located under the `tests/modules` folder. Default: `no`\n- `-DBUILD_EXAMPLE_MODULES=[yes|no]`  when set, the build will include the example modules located under the `src/modules` folder. Default: `no`\n\n## Common flags\n\n- `-DCMAKE_BUILD_TYPE=\u003cDebug|Release...\u003e` define the build type, see CMake manual for more details\n- `-DCMAKE_INSTALL_PREFIX=/installation/path` override this value to define a custom install prefix. Default: `/usr/local`\n- `-G\"\u003cGenerator Name\u003e\"` generate build files for \"Generator Name\". By default, CMake will generate `Makefile`s.\n\n## Verbose build\n\n`CMake` generates a user-friendly colorized output by default.\nIf you want to see a more verbose output, use the following:\n\n```bash\nmake VERBOSE=1\n```\n\n## Troubleshooting\n\nDuring the `CMake` stage, `CMake` caches variables in a local file named `CMakeCache.txt`. All variables generated by Valkey\nare removed from the cache once consumed (this is done by calling to `unset(VAR-NAME CACHE)`). However, some variables,\nlike the compiler path, are kept in cache. To start a fresh build either remove the cache file `CMakeCache.txt` from the\nbuild folder, or delete the build folder completely.\n\n**It is important to re-run `CMake` when adding new source files.**\n\n## Integration with IDE\n\nDuring the `CMake` stage of the build, `CMake` generates a JSON file named `compile_commands.json` and places it under the\nbuild folder. This file is used by many IDEs and text editors for providing code completion (via `clangd`).\n\nA small caveat is that these tools will look for `compile_commands.json` under the Valkey's top folder.\nA common workaround is to create a symbolic link to it:\n\n```bash\ncd /path/to/valkey/\n# We assume here that your build folder is `build-release`\nln -sf $(pwd)/build-release/compile_commands.json $(pwd)/compile_commands.json\n```\n\nRestart your IDE and voila\n\n# Code contributions\n\nPlease see the [CONTRIBUTING.md][2]. For security bugs and vulnerabilities, please see [SECURITY.md][3].\n\n# Valkey is an open community project under LF Projects\n\nValkey a Series of LF Projects, LLC\n2810 N Church St, PMB 57274\nWilmington, Delaware 19802-4447\n\n[1]: https://github.com/valkey-io/valkey/blob/unstable/COPYING\n[2]: https://github.com/valkey-io/valkey/blob/unstable/CONTRIBUTING.md\n[3]: https://github.com/valkey-io/valkey/blob/unstable/SECURITY.md\n","funding_links":[],"categories":["C","Core","Capabilities","Databases","Repos","redis"],"sub_categories":["Elasticity"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkey-io%2Fvalkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalkey-io%2Fvalkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkey-io%2Fvalkey/lists"}