[英]How to hot swap rebuilt database in an ASP.NET web app
I have a scenario where a an ASP.NET C# based web app is pulling data from a large SQL database that gets rebuilt by a separate app with fresh data every hour or so, the problem is that the rebuild process occasionally causes locks the interfere with the web app.我有一个场景,一个基于 ASP.NET C# 的 Web 应用程序正在从一个大型 SQL 数据库中提取数据,该数据库由一个独立的应用程序每隔一小时左右用新鲜数据重建,问题是重建过程偶尔会导致锁定干扰网络应用程序。 I was thinking about using a second database in order to have one DB rebuild, while the other was being used by the web app, and then have the two switch.
我正在考虑使用第二个数据库来重建一个数据库,而另一个数据库正在被 Web 应用程序使用,然后进行两个切换。 What is the best way to manage something like this, or is there a better approach in general?
管理此类事情的最佳方法是什么,或者一般来说有更好的方法吗?
if you only Pull data from the DB (not updating and/or making operations) a great idea could be instead of rebuilding the database making an Snapshot the database and work with that one, here are some useful articles that can guide you:如果您只从数据库中提取数据(不更新和/或进行操作),一个好主意可能是重建数据库,而不是重建数据库,制作数据库快照并使用该数据库,这里有一些有用的文章可以指导您:
Database Snapshots (SQL Server) 数据库快照 (SQL Server)
Understanding Database snapshots 了解数据库快照
SQL Server Database Snapshots (sqlservercentral) SQL Server 数据库快照 (sqlservercentral)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.