Redis Installation and Basic Configuration Guide

Redis Overview

Redis is a high-performance, open-source key-value database that operates entirely in-memory. Unlike traditional relational databases, Redis stores data as key-value pairs with support for various data structures, making it exceptionally versatile for caching, session management, real-time analytics, and message queue implementations.

Core Features

Persistence: Redis can persist data to disk, allowing memory-based data to survive process restarts. This combines the speed of in-memory operations with durability guarantees.

Data Structures: Beyond simple strings, Redis supports lists, sets, sorted sets (zset), hashes, bitmaps, hyperloglog, and streams. This rich type system enables complex operations without application-side data manipulation.

Replication: Redis implements master-slave replication, automatically synchronizing data across multiple nodes for improved read throughput and fault tolerance.

Performance Characteristics

Redis delivers exceptional throughput with read speeds reaching approximately 110,000 operations per second and write speeds around 81,000 operations per second. All operations are atomic, ensuring data consistency even under concurrent access patterns. Additional features include publish/subscribe messaging, key expiration, and Lua scripting support.


Installation

Windows

Download the Windows distribution from the official GitHub repository. Extract the archive to your preferred location, such as E:\redis.

Start the Redis server by opening a command prompt and navigating to the extraction directory:

E:\redis> redis-server.exe redis.windows.conf

With the server running in one terminal window, launch the CLI client in a new terminal to verify connectivity and perform basic operations:

E:\redis> redis-cli.exe -h 127.0.0.1 -p 6379
127.0.0.1:6379> SET sessionToken abc123
OK
127.0.0.1:6379> GET sessionToken
"abc123"

Linux

Obtain the latest stable release from the official Redis download page. The following commands download, compile, and install Redis from source:

$ wget https://download.redis.io/releases/redis-7.2.4.tar.gz
$ tar xzf redis-7.2.4.tar.gz
$ cd redis-7.2.4
$ make

After compilasion completes successfully, navigate to the source directory and launch the Redis server. By default, Redis starts with embedded configuration values:

$ cd src
$ ./redis-server

For custom configuration, specify a configuration file as a paramter:

$ cd src
$ ./redis-server ../redis.conf

Connect to the running instance using the CLI tool to validate the installation:

$ cd src
$ ./redis-cli
127.0.0.1:6379> SET cacheKey value123
OK
127.0.0.1:6379> GET cacheKey
"value123"

Configuration Management

Configuration File Location

The primary configuration file, redis.conf, resides in the Redis installation directory. This file controls all runtime parameters including network settings, memory limits, persistence options, and security configurations.

Runtime Configuration Queries

Redis provides the CONFIG GET command to inspect current settings without modifying the configurasion file. To retrieve all active configuration parameters:

127.0.0.1:6379> CONFIG GET *

For specific parameters, such as the maximum memory allocation:

127.0.0.1:6379> CONFIG GET maxmemory
1) "maxmemory"
2) "0"

Dynamic Configuration Changes

Two methods exist for modifying Redis configuration at runtime.

The first approach uses the CONFIG SET command, which immediately applies changes without restarting the service:

127.0.0.1:6379> CONFIG SET maxmemory 536870912
OK
127.0.0.1:6379> CONFIG SET appendonly yes
OK

The second approach involves directly editing the redis.conf file, followed by sending a CONFIG REWRITE command to persist changes:

# Edit redis.conf with preferred text editor
127.0.0.1:6379> CONFIG REWRITE
OK

Essential Configuration Parameters

Common parameters requiring adjustment include bind for network interface binding, port for listener port, daemonize for running as a background service, maxmemory for memory limit enforcement, and appendonly for enabling AOF persistence mode.

After configuring these parameters according to your deployment requirements, restart the Redis instance to ensure all settings take effect properly.

Tags: Redis NoSQL database configuration installation

Posted on Sat, 12 Sep 2026 16:48:29 +0000 by Transmission94