0

I'm working on a .NET 4 Winforms app and I'm having a problem deciding on the best way to handle the database. We want to offer a cloud database system where the app can communicate with the "cloud" via WCF services and essentially do the same thing as connecting to the local database (SQL Express locally, SQL Server 2008 R2 on the server).

We see two options:

1) Use WCF and make all calls to the cloud database 2) Use the local database and use Microsoft Sync Framework to keep the cloud in sync

We will eventually have a web application that will also use the cloud data as another front end for the user.

The dilemma is obviously which to use. If we go with Option 1 then we don't have to have a SQL Express installation everywhere the software is used, such as a public location and user's data may be downloaded to that DB. The WCF option allows all data to remain central.

We will eventually fold in mobile so iPhone, iPad, and Android can sync with the cloud as well.

I'm interested in your opinions on a strictly cloud database option vs. the occasionally connected option, i.e. database is local, synced to cloud.

Thank you.

4

1 回答 1

0

如果您想允许离线/偶尔连接场景,为什么不根据需要简单地选择选项 1) 和 2)?如果您通过 WCF 使用相同的 n 层架构来访问数据库,无论它在哪里(云或本地数据库),您的代码将始终相同,唯一的区别是偶尔连接的应用程序将同步数据(也可能是通过 WCF)。

同步与直接访问的一个问题是它不是实时的,即其他用户将访问和更新数据,您通常必须考虑如何处理冲突等。如果没有真正的需要(有时连接是主要原因) 对于离线功能,我会选择 1)。从上面也不清楚你将存储什么类型的数据,如果它是用户特定的,以及数据可能有多大,但在使用同步时,这些都是非常现实的问题,尤其是在安全性和性能方面。

如果您可以提供有关解决方案的确切用途的更多信息,它也可能会有所帮助。

于 2011-07-09T21:21:42.443 回答