当前位置:网站首页>Acid of redis

Acid of redis

2022-06-26 16:07:00 Hua Weiyun

Redis Of ACID

Atomicity

because redis Contains the transaction queue Save command , So it's atomic . All commands in the transaction queue will be executed or not executed at all . If an error occurs at runtime , be redis Transaction rollback is not supported . An error in a command will not affect the execution of the next command .

Uniformity

redis Ensure the consistency of transactions from three aspects

When joining the queue, the command does not exist or the format is wrong . redis This command will not be placed in the transaction queue .

If an error occurs while the command is running , Then these error commands will not make any changes to the database , To ensure consistency

If the server stops , After the server is not persisted and restarted , Obvious data match . stay RDB In mode , According to the existing RDB Recover data from files for consistency . stay AOF In mode , adopt AOF File consistency .

Isolation,

Redis It's isolated , Because it executes transactions on a single thread , And execute transactions serially

persistence

Obviously , If redis Not persistent , Transactions are not persistent . stay RDB In mode , Not immediately BGSAVE preservation , Therefore, there is no guarantee of persistence . stay AOF In mode ,appendfsync Option set to always, The program calls the synchronization function after executing the command to ensure the persistence .

summary

This is it. redis Of ACID, It has atomicity, consistency and isolation , stay appendfsync Option set to always There is persistence when .redis Transaction rollback is not supported , and mysql Of undolog The log guarantees the rollback operation of the transaction ,redo log Save the thinnest data , So as to ensure the persistence of transactions ,binlog Information used to record the updated data of the database , The information of query data will not be recorded , It is mainly used for data recovery and master-slave replication when data is down .

redis There are probably so many things to do , Let's get to know redis principle , Apply it to work and study together , Thank you for your support and encouragement , Continue refueling , Continue to work hard ,redis Very important , We need to know more about it .

️ Thank you for your

If you think this is helpful for you :

  1. Welcome to follow me ️, give the thumbs-up , Comment on , forward
  2. Focus on Panpan small class , Push good articles for you regularly , There are also group chat and irregular lottery activities , You can say what you want , Communicate with the great gods , Learning together .
  3. If there is anything inappropriate, you are welcome to criticize and correct .
原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261550115723.html