Improve development experience with Redis

Bluxmit
Towards Dev
Published in
3 min readJan 11, 2022

--

Redis is an amazing open-source, in-memory, key-value data store. It is fast, reliable, easy to use and has a great number of features. All of these made this database a great choice for the great variety of use-cases.

Setting up a development environment with Redis is very easy. We usually use docker-compose, and the docker-compose.yaml with Redis looks something like this

version: "3.2"
services:
redis:
image: redis
container_name: cache
app:
links:
- redis
environment:
- REDIS_URL=redis://cache

(this is a great oversimplification, of course. Usually, dev compose file is much larger and includes Nginx, databases, etc.)

Simply substitute a standard Redis image with this one — alnoda/redis-workspace and expose ports 8020–8035

version: "3.2"
services:
redis:
image: alnoda/redis-workspace
container_name: cache
ports:
- "8020-8035:8020-8035"
app:
links:
- redis
environment:
- REDIS_URL=redis://cache

Now in addition to Redis, you’ve got a whole set of tools with UIs, that simplify the exploration of Redis databases, get and set keys, important save datasets, and a whole lot more.

Open workspace UI http://localhost:800/ for quick access to all the tools

Use workspace terminal http://localhost:8026/ and load some Redis datasets

git clone https://github.com/redis-developer/redis-datasets.git /home/project/redis-datasetscat /home/project/redis-datasets/movie-database/import_actors.redis | redis-cli cat /home/project/redis-datasets/movie-database/import_movies.redis | redis-cli

Open Redis Commander on http://localhost:8029/ and explore Redis databeses

Alternatively use browser-based VS-code http://localhost:8025/ with Redis extension

In the Workspace terminal use iredis cli with autocompletion

If you prefer terminal tools, use Redis-Tui to explore data. Simpy execute in terminal

redis-tui

Create a dump of Redis database with redis-dump-go

redis-dump-go -h localhost > /home/redis-movie-dump.resp

and get to your local machine using File browser on http://localhost:8021

Disclamer: I am the creator of the redis-workspace image (and other workspaces in that repo). I use them for my own development, and happy to share with the community

--

--