• [redis5 source code learning] an analysis of the rename section of redis command


    baiyan Command syntax Command meaning: change the key to newkeyCommand format: RENAME key newkey Command actual combat:> keys * 1) “kkk” 2) “key1”> rename kkk key1 OK> keys * 1) “key1”> rename kkk kkk (error) ERR no such key Return value: if the name change is successful, it will prompt OK, […]

  • Use redis Bitmap bitmap to implement check-in function (PHP version)


    What needs to be optimized, please point out in your comments I. demand Record user sign in, query user sign in 2、 Technical proposal 1. Use MySQL (max’u time field is consecutive check-in days) Train of thought:(1) When the user checks in, insert a record, and query whether to check in yesterday according to create […]

  • After listening to API, let’s see what SPI is


    Quotation Usually API can hear a lot? What is SPI? Don’t worry. Let’s first look at the call relationship of interface oriented programming to understand the similarities and differences between API and SPI. SPI understanding Let’s start with an official introduction: the full name of SPI (service provider interface) is a built-in service provision and […]

  • Redis configuration file redis.conf in Chinese (based on 2.4)


    Copy codeThe code is as follows: #Redis sample profile #Note unit problem: when setting memory size, common formats like 1K, 5GB and 4m can be used:## 1k => 1000 bytes# 1kb => 1024 bytes# 1m => 1000000 bytes# 1mb => 1024*1024 bytes# 1g => 1000000000 bytes# 1gb => 1024*1024*1024 bytes##The unit is case insensitive, so […]

  • Redis master-slave replication and capacity expansion


    1、 Solve master-slave replication problems When redis is used as the storage engine and redis is used for read-write separation, the slave machine is used for read. When the slave machine is down or disconnected from the host machine, the host machine needs to be reconnected. Reconnecting the host machine will trigger a full amount […]

  • Redis database installation and configuration method


    Redis is a high-performance key value database. The emergence of redis largely compensates for the shortage of memcached keyValue storage, which can play a good complementary role to relational databases in some cases. It provides python, ruby, Erlang, PHP client, which is very convenient to use. The problem is that this project is still very […]

  • Some suggestions for redis to play a greater role in your system


    Redis is different from other database solutions in many aspects: it uses memory to provide main storage support, but only uses hard disk for persistent storage; its data model is very unique, using a single thread. Another big difference is that you can use redis functions in the development environment, but you don’t need to […]

  • Summary of redis common commands


    1、redis-benchmarkRedis benchmark information, redis server performance test redis-benchmark -h localhost -p 6379 -c 100 -n 100000100 concurrent connections, 100000 requests, performance of redis server with localhost port of 6379 detected [[email protected] redis-1.2.6]# redis-benchmark -h localhost -p 6379 -c 100 -n 100000 ====== PING ====== 10001 requests completed in 0.41 seconds 50 parallel clients 3 bytes […]

  • [redis5 source code learning] analysis of restore of redis command


    Grape Command syntax Command meaning: deserialize the given serialization value and associate it with the given key. Command format: RESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency] Command actual combat redis> DEL mykey 0 redis> RESTORE mykey 0 “\n\x17\x17\x00\x00\x00\x12\x00\x00\x00\x03\x00\ x00\xc0\x01\x00\x04\xc0\x02\x00\x04\xc0\x03\x00\ xff\x04\x00u#<\xc0;.\xe9\xdd” OK redis> TYPE mykey list redis> LRANGE mykey 0 -1 1) “1” […]

  • RPC remote method call through redis (supporting multiple programming languages)


    One of the things I’ve found that I’m constantly researching and excited about is extending the system. Now it means different things to different people. As part of porting monolithic to microservices architecture, how to deal with microservices architecture is the reason why I study RPC. RPC (or remote process call) is a concept that […]

  • Introduction to the use scenarios of five data structures in redis


    1、 Redis data structure usage scenario I’ve read the book redisbook, and I’m familiar with the basic functions of redis. I’ve read the source code of redis since last week. At present, the goal is to eat through the data structure of redis. We all know that there are five data structures in redis. What […]

  • Super detailed introduction to redis database


    [contents of this tutorial] 1. What is redis2. Who is the author of redis3. Who is using redis4. Learn to install redis5. Learn to start redis6. Use redis client7. Redis data structure – Introduction8. Redis data structure – strings9. Redis data structure – Lists10. Redis data structure – Collection11. Redis data structure – ordered set12. […]