不小心从redis中删除了一个table,有没有回滚之类的操作?
Accidentally deleted a table from redis, is there any roll back like operations?
做Redis一年了,还没遇到过这个问题。突然去删除了Table中的某条记录,把table全删了。我需要一些帮助。
根据 Redis 文档,它不支持回滚事务,如果您有关系数据库背景,Redis 命令可能在事务期间失败而不回滚这一事实对您来说可能很奇怪。
However there are good opinions for this behavior:
Redis commands can fail only if called with a wrong syntax (and the problem is not detectable during the command queueing), or against
keys holding the wrong data type: this means that in practical terms a
failing command is the result of a programming errors, and a kind of
error that is very likely to be detected during development, and not
in production.
Redis is internally simplified and faster because it does not need the ability to roll back.
Redis 没有回滚功能,除非在某些情况下你可以通过从文件恢复来作弊。我的意思是,您可以锁定 Redis 的 dump.rdb
文件进行写入并重新启动服务。 Redis 的状态将回滚到上次 fsync 到文件的时间。不过,不建议这样做。保存 Redis 状态的默认计时器为 15 到 1 分钟,具体取决于写入次数。
我是说真的,不要这样做。
做Redis一年了,还没遇到过这个问题。突然去删除了Table中的某条记录,把table全删了。我需要一些帮助。
根据 Redis 文档,它不支持回滚事务,如果您有关系数据库背景,Redis 命令可能在事务期间失败而不回滚这一事实对您来说可能很奇怪。
However there are good opinions for this behavior:
Redis commands can fail only if called with a wrong syntax (and the problem is not detectable during the command queueing), or against keys holding the wrong data type: this means that in practical terms a failing command is the result of a programming errors, and a kind of error that is very likely to be detected during development, and not in production.
Redis is internally simplified and faster because it does not need the ability to roll back.
Redis 没有回滚功能,除非在某些情况下你可以通过从文件恢复来作弊。我的意思是,您可以锁定 Redis 的 dump.rdb
文件进行写入并重新启动服务。 Redis 的状态将回滚到上次 fsync 到文件的时间。不过,不建议这样做。保存 Redis 状态的默认计时器为 15 到 1 分钟,具体取决于写入次数。
我是说真的,不要这样做。