保存和恢复数据库状态的功能
我想在我的程序中创建一个功能来保存当前的数据库状态并能够在将来恢复它。如果我回到两天前的某个状态,我还希望能够从今天开始返回到某个状态。我正在考虑从事务日志恢复数据库(每次我想保存状态时,我都会提交一个标记事务(在一些无关紧要的数据上))。是否有可能使用此解决方案恢复一些较早的状态,然后能够恢复较新的状态,或者我会在恢复后丢失它(或者它们会从事务日志中消失)?
I would like to create a functionality in my program to save current database state and be able to restore it in future. I would also like to be able, if I go back to some state from, let's say 2 days ago, to return to a state from today. I was thinking about restoring a database from a transaction log (everytime I want to save the state I commit a mareked transaction (on some insignificant data)). Is it possible at all, using this solution to restore some earlier state and after that be able to restore a more recent state, or would I lost it after the restore (or they would disappear form transaction log)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
数据库快照?
Database snapshots ?
我认为这是个坏主意。您应该查看 CQRS + 事件溯源解决方案。
I think this is bad idea. You should look at CQRS + Event Sourcing solution.