Redis common commands and scenarios

Author: Zen and the Art of Computer Programming

1 Introduction

Redis is an open source, high-performance key-value storage database that supports a variety of data structures, such as strings, lists, hashes, sets, etc. As a solution in NoSQL, Redis has been widely used in practical applications. This article will start with the 5 basic commands of Redis and introduce the commonly used features and best practices of Redis. It will also be explained based on commonly used Redis scenarios to introduce how to use these commands in different scenarios. In this way, readers can better master the usage skills of Redis.

2. Introduction to basic concepts and terminology of Redis

Introduction to Redis

Redis (Remote Dictionary Server) is an open source high-performance key-value storage database written by Salvatore Sanfilippo Sanchez and released in 2009, based on the BSD license agreement. Redis supports a variety of data types, including strings, hash tables, lists, sets, and ordered sets. Through efficient data structures, Redis can provide scalability, support multiple client connections, and provide multiple data access methods, such as a single command or complex transaction processing. Redis has rich features that can help developers build fast, reliable and distributed web applications or mobile applications.

Introduction to important Redis terms

  • Key: All elements in redis are called keys. Each key is unique, and a key can only correspond to one value. The longest Key length in Redis is 512MB.
  • Value: Value in Redis can be any type of object, such as String, Hash, List, Set, Sorted Set, etc. Value can reach a maximum of 512MB.
  • Expire (expiration time): Setting the expiration time allows Redis to automatically delete expired keys. The command to set the expiration time is EX

Guess you like

Origin blog.csdn.net/universsky2015/article/details/132899758