简体   繁体   English

将SQL数据迁移到Azure / Cloud

[英]Migrating SQL data to Azure/Cloud

I have a desktop app written on the premise that there will be many users, each with their own SQL database installation on their local machines. 我有一个桌面应用程序,其前提是会有许多用户,每个用户都在自己的本地计算机上安装自己的SQL数据库。

If we want to migrate the entire project to the web, including user data, then, it would seem that the data tables would have to be modified to include a UserID column. 如果我们想要将整个项目迁移到Web(包括用户数据),那么似乎必须修改数据表以包含UserID列。

For example, if User A had records 1 and 2, and User B had records 3 and 4, we would not want User A accessing User B's records. 例如,如果用户A有记录1和2,而用户B有记录3和4,我们不希望用户A访问用户B的记录。 Therefore, a column would be added to the tables to store UserID and all queries and updates would be modified to add the UserID. 因此,将向表中添加一列以存储UserID,并且将修改所有查询和更新以添加UserID。

This sounds like a real pain if this is necessary. 如果有必要,这听起来真的很痛苦。 I am unfamiliar with the Database schema in cloud services. 我不熟悉云服务中的数据库架构。 Is a re-design of the database as described above really necessary, or is there some other way in which this problem has been dealt with to make a migration to the cloud more seamless? 是否真的有必要对上述数据库进行重新设计,还是有其他方法可以解决此问题,以便更加无缝地迁移到云?

Thanks. 谢谢。

你可以看看联邦数据库,但它仍然意味着你必须做一些工作: http//msdn.microsoft.com/en-us/library/windowsazure/hh597452.aspx希望这有帮助吗?

Does the data need to be in a SQL Server / Database store? 数据是否需要在SQL Server /数据库存储中? If the data is not relational, then perhaps consider using Windows Azure table storage and having the (new) web app separate data by partition key (ie the userID). 如果数据不是关系数据,则可以考虑使用Windows Azure表存储并使(新)Web应用程序按分区键(即userID)分隔数据。

If it is relational data, and there is a requirement to have separate databases, then I think your best option is to shard the databases manually, or use SQL Database federations like @techmike2kx suggested. 如果它是关系数据,并且需要有单独的数据库,那么我认为您最好的选择是手动分片数据库,或使用@ techmike2kx建议的SQL数据库联合。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM