Skip to main content
ValKeyper is a Redis-compatible in-memory key-value store written in Go. This guide will get you up and running in just a few minutes.

Prerequisites

Before you begin, ensure you have:
  • Go 1.22 or later installed
  • redis-cli installed (for testing)
  • Basic familiarity with Redis commands

Quick Start

1

Clone the repository

Clone the ValKeyper repository to your local machine:
git clone https://github.com/vansh845/valkeyper.git
cd valkeyper
2

Build ValKeyper

Build the project using Go:
go build
This will create a valkeyper executable in your current directory.
3

Start the server

Run the ValKeyper server on the default port (6379):
./valkeyper
You should see output indicating the server is listening:
Listening on port 6379
By default, ValKeyper listens on 0.0.0.0:6379, making it accessible from any network interface.
4

Connect with redis-cli

In a new terminal, connect to ValKeyper using the standard Redis CLI:
redis-cli -p 6379
5

Execute your first commands

Try these basic commands to verify everything is working:
# Test connectivity
PING
# Response: PONG

# Set a key-value pair
SET mykey "Hello ValKeyper"
# Response: OK

# Retrieve the value
GET mykey
# Response: "Hello ValKeyper"

# Set a key with expiration (10 seconds)
SET tempkey "temporary value"
EXPIRE tempkey 10

# Increment a counter
SET counter 0
INCR counter
# Response: 1
INCR counter
# Response: 2

Common Commands

ValKeyper supports the following Redis commands:

Basic Operations

  • SET key value - Store a value
  • GET key - Retrieve a value
  • DEL key - Delete a key
  • KEYS * - List all keys

Advanced Features

  • EXPIRE key seconds - Set TTL
  • INCR key - Increment counter
  • TYPE key - Get key type

Transactions

  • MULTI - Begin transaction
  • EXEC - Execute transaction
  • DISCARD - Cancel transaction

Streams

  • XADD stream * field value - Add to stream
  • XRANGE stream start end - Query range
  • XREAD streams stream 0-0 - Read from stream

Example: Using Transactions

Transactions ensure atomic execution of multiple commands:
redis-cli
> MULTI
OK
> SET balance 100
QUEUED
> INCR balance
QUEUED
> GET balance
QUEUED
> EXEC
1) OK
2) (integer) 101
3) "101"

Example: Working with Streams

Streams enable event-driven data flows:
# Add entries to a stream
XADD mystream * sensor temperature 25
XADD mystream * sensor temperature 26

# Read all entries
XRANGE mystream - +

# Read new entries (blocking)
XREAD block 1000 streams mystream $

Running on a Different Port

To run ValKeyper on a custom port:
./valkeyper --port 6380
Then connect with:
redis-cli -p 6380

What’s Next?

Installation

Learn about building from source, configuration options, and system requirements

Replication

Set up master-slave replication for high availability

Persistence

Configure RDB persistence to save data to disk

Commands Reference

Explore all supported Redis commands
ValKeyper is designed for learning and development purposes. For production use cases, consider using Redis or Valkey.

Build docs developers (and LLMs) love