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

JavaScript function detailed introduction

Any number of statements can be encapsulated thro...

Analyze Mysql transactions and data consistency processing issues

This article analyzes the consistency processing ...

MySQL 5.7.18 Installer installation download graphic tutorial

This article records the detailed installation tu...

How to use axios request in Vue project

Table of contents 1. Installation 2. There is no ...

15 Best Practices for HTML Beginners

Here are 30 best practices for HTML beginners. 1....

JavaScript history object explained

Table of contents 1. Route navigation 2. History ...

Introduction to Docker Quick Deployment of SpringBoot Project

1. Install Docker First open the Linux environmen...

Vue implements a small weather forecast application

This is a website I imitated when I was self-stud...

Two ways to clear table data in MySQL and their differences

There are two ways to delete data in MySQL: Trunc...

Detailed explanation of the use of base tag in HTML

In requireJS, there is a property called baseURL....

How to implement element floating and clear floating with CSS

Basic Introduction to Floating In the standard do...

In-depth explanation of MySQL user account management and permission management

Preface The MySQL permission table is loaded into...

JavaScript css3 to implement simple video barrage function

This article attempts to write a demo to simulate...