ASP.NET MVC调试最佳实践

时间:2022-09-18 08:10:25

We currently make website debugging on a remote sales_debug database instead of the production remote sales one.

我们目前在远程sales_debug数据库而不是生产远程销售数据库上进行网站调试。

The problem is speed, using the remote database from the local machine is very slow. I was trying to install SQL Server Express and SSMS on my local Win 8.1 machine and found it so complicated. This is link that made wondering if I was doing the right thing.

问题是速度,从本地机器使用远程数据库非常慢。我试图在我的本地Win 8.1机器上安装SQL Server Express和SSMS,发现它太复杂了。这是一个让人想知道我是否做得对的链接。

The questions are:

问题是:

  1. What is the best configuration to make website that uses a DB debugging? Maybe I should use a less invasive DB engine with the same content?
  2. 使网站使用数据库调试的最佳配置是什么?也许我应该使用具有相同内容的侵入性较小的数据库引擎?

  3. Is a local copy of the DB the way to go? Or there is a trick to speed up connections to remote server?
  4. 是DB的本地副本的方法吗?或者有一个加速远程服务器连接的技巧?

Thanks.

2 个解决方案

#1


0  

You have a machine in same network of your? You can use as a local server. Install SSMS in this your machine then, SqlServer Express in your local server.

您的机器在同一个网络中吗?您可以用作本地服务器。然后在本机中安装SSMS,然后在本地服务器中安装SqlServer Express。

#2


0  

The fastest, and also best practice for testing your app to a database is to mock it away for your tests.You can use techniques like dependency injection and inject a fake database that is local and fast into your controller constructor and that way the results of the test is consistent and it is blazingly fast. Traditionally this is used for unit testing and other types of automated tests, but I don't see why you couldn't do this for manual tests as well. The same benefits apply.

测试应用程序到数据库的最快,最好的做法是模拟它以进行测试。您可以使用依赖注入等技术,并将一个本地快速的假数据库注入到控制器构造函数中,这样就可以得到结果。测试是一致的,而且速度非常快。传统上这用于单元测试和其他类型的自动化测试,但我不明白为什么你也不能这样做手动测试。同样的好处也适用。

#1


0  

You have a machine in same network of your? You can use as a local server. Install SSMS in this your machine then, SqlServer Express in your local server.

您的机器在同一个网络中吗?您可以用作本地服务器。然后在本机中安装SSMS,然后在本地服务器中安装SqlServer Express。

#2


0  

The fastest, and also best practice for testing your app to a database is to mock it away for your tests.You can use techniques like dependency injection and inject a fake database that is local and fast into your controller constructor and that way the results of the test is consistent and it is blazingly fast. Traditionally this is used for unit testing and other types of automated tests, but I don't see why you couldn't do this for manual tests as well. The same benefits apply.

测试应用程序到数据库的最快,最好的做法是模拟它以进行测试。您可以使用依赖注入等技术,并将一个本地快速的假数据库注入到控制器构造函数中,这样就可以得到结果。测试是一致的,而且速度非常快。传统上这用于单元测试和其他类型的自动化测试,但我不明白为什么你也不能这样做手动测试。同样的好处也适用。