Lock screen interview questions 100 days, adhere to update the interview questions every working day. Lock screen interview questions APP and mini program are now online, official website address:https://www.demosoftware.cc/#…. It has included all the contents of the interview questions updated daily, as well as features such as unlocking screen review interview questions, daily programming questions email push, etc. This will give you a head start in the interview and give the interviewer a leg up! Here are today’s interview questions:

==== What is the benefit of Pipeline in Redis and why Pipeline? Multiple IO round-trips can be reduced to one if there is no causal correlation between the instructions executed by the PIPELINE. When using Redis-Benchmark to run a test, it can be found that an important factor that affects the QPS peak in Redis is the number of Pipeline batch instructions.

==== Have you ever used Redis clustering, and what is the rationale for clustering?

  1. Redis Sentinal focuses on high availability, and will automatically promote slave to master when the master is down, and continue to provide service.
  2. , Redis Cluster focuses on scalability. When the memory of a single Redis is insufficient, the Cluster is used for sharding storage.

==== When does a Redis clustering solution make an entire cluster unusable? If A cluster with nodes A, B, and C does not have A replication model, if node B fails, then the entire cluster will be deemed to lack slots in the range 5501-11000 and will not be available.

==== What are the Java clients supported by Redis? Which is the official recommendation? Lettuce, Redisson, Jedis, lettuce, etc. The official recommendation is Redisson.

==== What are the advantages and disadvantages of Jedis compared with Redisson? Jedis is the Java implementation of Redis client, its API provides a relatively comprehensive Redis command support; Redisson implements a distributed and extensible Java data structure. Compared with Jedis, it has relatively simple functions. It does not support string manipulation, sorting, transactions, piping, partitioning, and other Redis features. The goal of Redisson is to facilitate the separation of attention from Redisso that users can focus more on dealing with the business logic.

==== How to set and verify a password for Redis? Config set requirepass 123456 AUTH 123456 AUTH 123456 AUTH 123456

==== What about the concept of Redis Hash Slot? Redis cluster does not use consistent hash, but introduces the concept of hash slot. Redis cluster has 2 to the 14th power (16,384) hash slots. After CRC16 verification, each key takes the module of 16384 to decide which slot to place.

====Redis uses the concept of hashing slots instead of a consistent hashing algorithm. Why? Redis Cluster is a simple hash algorithm of CRC16 made by itself, and does not use consistent hash. The authors of Redis say that its CRC16 (Key) mod 16384 works pretty well, and while it’s not as flexible as consistent hash, it’s very simple to implement, and it’s very easy to handle when adding or deleting nodes.

==== What is the master-slave replication model for a Redis cluster? In order to make the cluster usable even if some nodes fail or most of the nodes are unable to communicate, the cluster uses a master-slave replication model where there are n-1 replicas per node.

==== Will write operations be lost in the Redis cluster? Why is that? Redis does not guarantee strong data consistency, which means that in practice the cluster may lose writes under certain conditions.

==== How do Redis clusters replicate between each other? Asynchronous replication

==== What is the maximum number of nodes in a Redis cluster? 2 to the 14th power (16,384)

==== How to select database for Redis cluster? Redis Cluster is currently unable to make database selection, default is 0 database.

==== What about Redis transactions? Redis transactions can execute more than one command at a time, and come with three important guarantees: 1) Batch operations are placed in the queue cache before sending EXEC commands. 2) After receiving the EXEC command, it enters the transaction execution. Any command in the transaction fails to execute, and the rest commands are still executed. 3) During the execution of a transaction, the command request submitted by other clients will not be inserted into the sequence of transaction execution commands. 2. A transaction goes through the following three phases from inception to execution: The transaction begins. Command line up. Execute transactions. 3. The relevant instructions in Redis include: DISCARD the transaction, DISCARD all the commands within the transaction block. EXEC executes all commands within a transaction block. Multi marks the start of a transaction block. UNWATCH unwatches all keys monitored by WATCH command. WATCH key [key …] Monitor one (or more) keys; if this (or these) keys are altered by another command before the transaction is executed, the transaction will be interrupted. The execution of a single Redis command is atomic, but Redis does not add any mechanism to the transaction to maintain atomicity, so the execution of a Redis transaction is not atomic. A transaction can be thought of as a packaged batch execution script, but a batch instruction is not an atomized operation, and the failure of an intermediate instruction will not result in the rollback of previous instructions or the failure of subsequent instructions. Redis > multi OK redis > set a aaa QUEUED redis > set b BBB QUEUED redis> Set C CCC Queued Redis> Exec 1) OK 2) OK 3) OK

==== How to set the expiration time and permanent validity of the Redis key respectively? Use the EXPIRE and PERSIST commands.

==== How does Redis do memory optimization? Use hashes whenever possible. Hashes use very little memory, so you should abstract your data model into a hash table as much as possible. For example, if you have a user object in your web system, instead of setting a single key for the user’s first name, last name, email address, and password, store all of the user’s information in a hash table.

More interview questions can be paid attention to the official account of “Demo Lock Screen Interview Questions”. Interview questions and learning resources can be obtained through the mini program or APP