redis是如何做到在不支持原子性的基础上支持一致性的?
某草草
某草草 2017-04-25 09:02:20
0
2
967

最近在学习redis,关于它对事务的支持不是很理解。redis在执行事务中的命令时,出错后不会回滚,但是又看到有人说redis是支持一致性的。我一直以为原子性是一致性的保证之一,如何在不支持原子性的基础上支持一致性的呢?

某草草
某草草

reply all(2)
洪涛

Redis cannot guarantee consistency
Redis transactions do not support rollback, because its function is only for efficient reading of data, not data storage.
The watch command can add optimistic locking to the specified key. During transaction execution and before exec is submitted, if other sessions change the key, the transaction will fail.

For details, please refer to: http://m.blog.csdn.net/article/details?i...

过去多啦不再A梦

Single process, so it is atomic, but rollback is another concept. .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template