Introduction to Valkey
- WHAT?
Valkey is an open source in-memory data structure store that excels as a database, cache, message broker and streaming engine. Valkey provides a high-performance, scalable and versatile in-memory data store, crucial for accelerating applications and efficiently managing diverse data needs with enhanced multi-threading and reliability.
- WHY?
Learn about how to install and configure Valkey.
- EFFORT
40 minutes of reading time.
- GOAL
Setting up Valkey on SUSE Linux Enterprise Server for SAP applications or migrating from Redis to Valkey.
1 About Valkey #
Valkey is a fork of Redis version 7.2.4. It is an open source, in-memory data structure store, licensed under the BSD (Berkeley Software Distribution) license, that serves as a versatile platform for various applications. It excels as a database, providing fast and flexible data storage; as a cache, significantly improving application performance; as a message broker, enabling asynchronous communication; and even as a streaming engine for real-time data processing. Valkey builds upon the foundation of Redis OSS, incorporating multi-threading for enhanced performance and offering a robust solution for applications demanding speed, scalability, and diverse data handling capabilities.
Valkey has many benefits, which include the following:
Delivers fast, low-latency access to data stored in memory, ideal for caching, real-time analytics, and message brokering.
Supports powerful and versatile data structures like strings, hashes, lists, sets, sorted sets, streams, and geo-spatial indexes.
Offers RDB (Redis Database Backup) snapshot and AOF (append-only file) persistence for recovering data after restarts.
Enables horizontal scaling by partitioning data across multiple nodes.
Maintains compatibility with Redis 7.2, making it easy to migrate without changing existing client libraries or application logic.
Provides built-in publish/subscribe capabilities for building event-driven or messaging-based systems.
For more information on Valkey, refer to https://valkey.io/docs/.
2 Managing Valkey #
Learn how to install Valkey, use the command-line tool and migrate from Redis to Valkey.
2.1 Setting up a Valkey service file #
Valkey is an open-source and in-memory data store that functions as a database, cache, message broker and streaming engine.
systemd service file #Install Valkey:
>sudozypper -n in valkeyCreate a Valkey
systemdservice file:>sudovi /etc/systemd/system/valkey.serviceAdd the following to the file:
[Unit] Description=Valkey In-Memory Data Store After=network.target [Service] User=valkey Group=valkey ExecStart=/usr/sbin/redis-server /etc/redis/valkey.conf LimitNOFILE=10240 ExecStop=/usr/bin/valkey-cli shutdown Restart=always [Install] WantedBy=multi-user.targetCopy the sample file to the specified config file:
>sudocp /etc/valkey/default.conf.example /etc/valkey/valkey.confUpdate file permissions:
>sudochown valkey:valkey /etc/valkey/valkey.confStart and enable the Valkey service:
>sudosystemctl start valkey>sudosystemctl enable valkeyVerify the Valkey setup:
valkey-cli ping
Valkey is running on your system when you get the command print
PONG.
2.2 The Valkey command-line interface #
The Valkey command-line interface is used for managing, debugging and testing Valkey.
By default, the valkey-cli command connects to the server at the address 127.0.0.1 with port 6379.
Some of the valkey-cli command options include:
-hServer host name with default ip of 127.0.0.1.
-pServer port with a default vale of 6379.
-tServer connection timeout in seconds (decimals allowed). Default timeout is
0, which means no limit and depends on the operating system.-sServer socket overrides the host name and port.
-aPassword to use when connecting to the server. You can also use the
VALKEYCLI_AUTHenvironment variable to pass this password more safely. This argument takes precedence when both options are used.--userUser name that is used to send ACL (Access Control List) style, which is
AUTH username pass. Needs the-aoption.--passPassword that is an alias of the
-aoption to align with the new--useroption.--askpassForces password input via STDIN with masking. If this argument is used, then
-aand theVALKEYCLI_AUTHenvironment variable are ignored.-uServer URI in format
valkey://user:password@host:port/dbnum. User, password and dbnum are optional. For authentication without a user name, use user namedefault. For TLS, use the schemevalkeys.--helpOutput help and exit.
--versionOutput version and exit.
--cluster helpList all available cluster manager commands.
valkey-cli command examples include: #SET: Sets a key-value pair.>valkey-cli SET KEY_NAME "Hello Valkey"For example:
>valkey-cli SET TESTKEY "Hello Valkey"GET: Retrieves the value associated with a key.>valkey-cli GET TESTKEY "Hello Valkey"DEL: Deletes a key.>valkey-cli DEL TESTKEY (integer) 11if deleted and0if not found.INFO: Displays information and statistics about the Valkey server.>valkey-cli INFO Server redis_version:7.2.4 server_name:valkey valkey_version:8.0.2 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:e0cc1d08b1f9571a server_mode:standalone os:Linux 6.12.0-160000.9-default x86_64 arch_bits:64 monotonic_clock:POSIX clock_gettime multiplexing_api:epoll gcc_version:13.3.1 process_id:974 process_supervised:no run_id:32864c141804bcb17cae98145beee86ca251afd7 tcp_port:6379 server_time_usec:1750760734442451 uptime_in_seconds:2780 uptime_in_days:0 hz:10 configured_hz:10 lru_clock:5930270 executable:/usr/sbin/redis-server config_file:/etc/valkey/valkey.conf io_threads_active:0 availability_zone: [...]MONITOR: Streams all commands processed by the Valkey server in real time.>valkey-cli MONITOR OKKEYS: Finds all keys matching a pattern.>valkey-cli KEYS "*" # All keys "TESTKEY" "TESTKEY1"
2.3 Migrating from Redis to Valkey #
Valkey is designed to be a seamless replacement, maintaining compatibility with the Redis API, protocol, persistence data, ports and configuration files. The transition from Redis to Valkey is easy for many basic setups. The following procedure assumes Redis is installed, running and loaded with data.
Check the current Redis server version:
>redis-cli info server # Server redis_version:7.2.4 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:8c22b097984bd350 redis_mode:standalone [...]Install valkey-compat-redis package with the
--force-resolutionoption:>sudo# zypper in --force-resolution valkey-compat-redis Refreshing service 'NVIDIA'. Refreshing service 'openSUSE'. Loading repository data... Reading installed packages... Resolving package dependencies... The following 2 NEW packages are going to be installed: valkey valkey-compat-redis The following package is going to be REMOVED: redis 2 new packages to install, 1 to remove. Package download size: 1.3 MiB Package install size change: | 5.2 MiB required by packages that will be installed -245.2 KiB | - 5.4 MiB released by packages that will be removed Backend: classic_rpmtrans Continue? [y/n/p/...? shows all options] (y):The package takes your existing configuration files and persistence data and moves them to Valkey with no additional steps required. This migration is possible because Valkey is fully compatible with the Redis API, protocol, persistence data, ports and configuration files.
Start and enable Valkey:
>sudosystemctl start valkey>sudosystemctl enable valkeyCheck the server information:
>redis-cli info server # Server redis_version:7.2.4 server_name:valkey valkey_version:7.2.5 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:b0d9f188ef999bd3 redis_mode:standalone [...]Valkey is responsive to both
redis_version:7.2.4andvalkey_version:7.2.5. Retaining theredis_versionensures maximum compatibility while still identifying the server withvalkey_version. Valkey has a binary namedvalkey-clibut symbolically linksredis-cli. Both CLIs have the same functionality.
3 Legal Notice #
Copyright© 2006–2025 SUSE LLC and contributors. All rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled “GNU Free Documentation License”.
For SUSE trademarks, see https://www.suse.com/company/legal/. All other third-party trademarks are the property of their respective owners. Trademark symbols (®, ™ etc.) denote trademarks of SUSE and its affiliates. Asterisks (*) denote third-party trademarks.
All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither SUSE LLC, its affiliates, the authors, nor the translators shall be held liable for possible errors or the consequences thereof.