Valkey As Redis Replacement

A pciture of scaling your web app ith Redis Caching to signify Valkey as Redis alternative

Quick Introduction To Valkey

Redis (Remote Dictionary Server) is a popular in-memory key-value pair database that is often used as a distributed cache. On 2024-03-20, Redis announced that future versions of Redis will be released under dual source-available licenses and not longer the three-clause Berkeley Software Distribution (BSD). Thus, Valkey began as a fork of Redis 7.2.4 as a project of the Linux Foundation.

Storing key-value pairs in RAM allows for faster database speeds than accessing from storage drives. Valkey has master-replica replication, clusters scaling up to 100 nodes, supports different abstract data structures, including strings, lists, maps, sets, sorted sets, hyperloglogs, bitmaps, streams, and geo-spatial indices.

This tutorial install Valkey and its subpackage script for Redis conversion and symlinks. The PHP Redis extension will also be installed on the server. Finally a WordPress plugin that allows Redis to be used a cache will be installed and activated. Contact OjamboServices.com for WordPress diagnostics, migrations, upgrades, custom plugins and themes.

Requirements For Valkey

Glossary:

Cache

Hardware or software component that stores data so that future requests for that data can be served faster.

Database

Organized collection of data or a type of data store.

Cluster

Connecting more than one single database instance.

HyperLogLog

Algorithm for the count-distinct problem, approximating the number of distinct elements in a multiset.

Symlink

Symbolic links that are created with the symlink system call.

Test Tools

Test Criteria
Name Description
Boast App Performance Noticed faster speed in WordPress Admin area.
Full Persistence Can be set to run on system boot.
Ease Of Use Used the default settings.
Name Description

Install Valkey And Related PHP Extension

# Install Valkey On Fedora Linux #
sudo dnf install valkey

# Install Valkey Compatibility Package On Fedora Linux #
sudo dnf install valkey-compat-redis

# Install PHP Redis Extension On Fedora Linux #
sudo dnf install php-pecl-redis


Install Redis Object Cache Plugin For WordPress

  1. Login to WordPress site.
  2. Navigate to the WordPress Admin dashboard
  3. Navigate to Plugins -> Add New Plugin
  4. Search for Redis
  5. Install and activate a plugin such as Redis Object Cache

Explanation:

  1. WordPress slows down when resource-heavy plugins are used due to heavy database use.
  2. A caching mechanism using Valkey will speed up both the front-end and back-end.
  3. Valkey stores important data in memory for almost instant delivery.

Screenshots:

Redis Server Current Information
Redis Server Command Line Current Information

WordPress Plugin Redis Search
WordPress Add New Plugin Search Results For Redis

WordPress Redis Object Cache
WordPress Redis Object Cache Plugin Enabled


Open Source

Valkey is licensed under the BSD 3-Clause License. The permissive license has conditions requiring preservation of copyright and license notices. It allows commercial use, modification, distribution, and allows making derivatives proprietary, consult the license for more specific details.

Conclusion:

WordPress can use a Redis server to improve its performance, particularly by reducing the load on the database and speeding up page load times. Valkey is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It is a NoSQL database used on dynamic websites like WordPress sites for object caching, which caches repeating query results to serve them faster on subsequent requests. Get complete diagnosis and professional support available at OjamboServices.com.

If you enjoy this article, consider supporting me by purchasing one of my OjamboShop.com Online Programming Courses or publications at Edward Ojambo Programming Books or simply donate here Ojambo.com Donate

References:

Leave a Reply

Your email address will not be published. Required fields are marked *