内存数据库作为数据库故障的备份
内存数据库是否是在数据库发生故障时执行读取操作的可行备份选项?人们可以偶尔将数据插入到内存数据库中,并且在数据库服务器/Web 服务器出现故障(很少发生)的情况下,人们仍然可以在 Web 服务器之外访问内存数据库中存在的数据。
Is in-memory database a viable backup option for performing read operations in case of database failures? One can insert data into an in-memory database once in a while and in case the database server/web server goes down (rare occurence), one can still access the data present in the in-memory database outside of web server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您要将整个数据库保存在内存中,您也可以在那里执行所有操作并将备份保存在磁盘上。
If you're going to hold your entire database in memory, you might just as well perform all operations there and hold your backup on disk.
不,因为断电意味着您的数据库消失了。或者,如果数据库进程终止,操作系统会释放它正在使用的所有内存。
我建议使用第二个硬盘驱动器(外部或内部),并将数据转储到该硬盘驱动器。
No, since a power outage means your database is gone. Or if the DB process dies, and the OS deallocates all the memory it was using.
I'd recommend a second hard drive, external or internal, and dump the data to that hard drive.
显然,这可能取决于您的数据库使用情况。例如,我很难想象 StackOverflow 会这样做。
另一方面,并非每个应用程序都是如此。如果您的数据库使用受到限制,您可以从移动应用程序中获取提示,该应用程序接受服务器可能并不总是可用的事实。将您的 Web 应用程序视为移动客户端。请参阅使用面向服务的体系结构构建断开连接的移动应用程序
Obviously it probably depends on your database usage. For instance it would be hard for me to imagine StackOverflow doing this.
On the other hand not every application is SO. If your database usage is limited you could take a cue from Mobile Applications which accept the fact that a server may not always be available. And treat your web application as though it were a Mobile Client. See Architecting Disconnected Mobile Applications Using a Service Oriented Architecture