Docker installs Redis and introduces the visual client for operation

Docker installs Redis and introduces the visual client for operation

1 Introduction

Redis is a high-performance NoSQL database based on Key-Value developed in ANSI C language. It plays an important role in solving a series of problems such as high concurrency and high availability. Its main advantages are:

Fast speed. Persistence. Atomicity. Rich data structure. Multi-language support.

This article will briefly introduce how to install Redis through Docker and simply use and operate it.

2 Docker installation and use

2.1 Docker Installation

Pull the Redis image and select the latest stable version 5.0.8 :

$ docker pull redis:5.0.8

It is recommended to configure it as Alibaba Cloud's mirror, which will be much faster. After the pull is successful, you can check it with the following command:

$ docker images |grep redis

Start Redis :

$ docker run -itd --name redis -p 6379:6379 redis:5.0.8

Check whether the startup is successful by running the following command:

$ docker ps | grep redis

Enter the container:

$ docker exec -it redis /bin/bash

Connect to the database through the Redis command line tool in the container:

$ redis-cli -h localhost -p 6379

Of course, you don't have to specify hostname and port . The default is 127.0.0.1:6379 .

After the connection is successful, you can operate:

You can do a simple performance test on the installed Redis by using the following command:

$ redis-benchmark -n 100000 -q

The results are as follows:

It can be seen that although it is installed through Docker , the performance is still good. Basically, 45,000 read and write operations can be completed per second.

2.2 Common Redis Operations

Redis has rich data structures and powerful functions. Here are some common commands:

# Start the Redis service redis-server [--port 6379]
# Command line connection redis-cli [-h 127.0.0.1 -p 6379]
# Set key value
# Query value get key
# Query type type key
# Delete del key1 key2 key3
# Get the keys list keys pattern
# Query the key life cycle ttl key
pttl key
# Increasing and decreasing values ​​(for numbers)
incr key
incrby key step
decr key
decrby key step

There are too many to list here. You can go to (http://www.redis.cn/commands.html) to check, which contains all the commands and detailed Chinese descriptions.

3 Visual Client

It is sometimes not convenient to view and operate through the command line. There are many visual clients for Redis . Here are 4 of them.

3.1 RedisClient

A visualization tool developed based on Java SWT and Jedis . Open source and free, supports Windows , Linux and Mac , address: https://github.com/caoxinyu/RedisClient, but it has not been updated for a long time.

3.2 RedisStudio

A free visualization tool for Windows that hasn't been updated for a long time.

3.3 RedisDesktopManager

A cross-platform tool developed based on Qt 5 . It supports Windows , Linux and Mac , but it is paid and not cheap.

3.4 AnotherRedisDesktopManager

An excellent and beautiful open source free visualization tool that supports Windows , Linux and Mac , supports switching between Chinese and English, and dark and white themes. After comparison, I think this one is the best.

The Github address is: https://github.com/qishibo/AnotherRedisDesktopManager

You can download and install it from Github . After successful installation, the configuration connection is as shown in the figure:

It is convenient to query, add, modify, delete and other operations on key :

It also provides command line tools, which is really thoughtful:

4 Conclusion

This article introduces how to use Redis through Docker installation. Of course, if you don’t want to bother, you can directly experience the online version of Redis on the official website (http://try.redis.io/).

In addition, four Redis visual client tools are introduced. After comparison, AnotherRedisDesktopManager is found to be more useful.

This is the end of this article about installing Redis with Docker and visualizing the client operation. For more information about installing Redis with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Recommend several Redis visualization tools (too powerful)
  • Redis Visual Client Summary
  • About the problem of garbled data read by redis visualization tool

<<:  mysql 8.0.18 mgr installation and its switching function

>>:  Vue implements the magnifying glass effect of tab switching

Recommend

Vue implements local storage add, delete and modify functions

This article example shares the specific code of ...

JavaScript source code for Elimination

JavaScript to achieve the source code download ad...

Html Select uses the selected attribute to set the default selection

Adding the attribute selected = "selected&quo...

Drawing fireworks effect of 2021 based on JS with source code download

This work uses the knowledge of front-end develop...

How to use Navicat to export and import mysql database

MySql is a data source we use frequently. It is v...

Detailed steps for installing, configuring and uninstalling QT5 in Ubuntu 14.04

1. I downloaded QT5.13 version before, but after ...

Detailed explanation of Nginx access restriction configuration

What is Nginx access restriction configuration Ng...

How to install babel using npm in vscode

Preface The previous article introduced the insta...

Summary of various uses of JSON.stringify

Preface Anyone who has used json should know that...

About deploying a web project to Alibaba Cloud Server (5 steps to do it)

1. First log in to the Alibaba Cloud website to r...

How to use lazy loading in react to reduce the first screen loading time

Table of contents use Install How to use it in ro...

How to update v-for in Vue

Tips: Array change method will cause v-for to upd...

Vue implements Tab tab switching

This article example shares the specific code of ...

How to add ansible service in alpine image

Use apk add ansible to add the ansible service to...