简体   繁体   English

现有Asp.Net网站的Azure云服务与VM

[英]Azure Cloud Services vs VMs for Existing Asp.Net website

I have seen variations of this question but couldn't find any that dealt with our particular scenario. 我已经看到了这个问题的变体,但找不到与我们的特定情况相关的任何问题。

We have an existing aps.net website that links to a SQL Server database. 我们有一个现有的aps.net网站,它链接到SQL Server数据库。 The database has clr user-defined types, hence it can only be hosted in Azure VM since Cloud Services don't support said types. 该数据库具有clr用户定义的类型,因此它只能托管在Azure VM中,因为Cloud Services不支持上述类型。

We initially wanted to use a vm for the database and cloud service for the front-end, but then some issues arose: 我们最初希望将vm用于前端数据库和云服务,但是随后出现了一些问题:

  1. We use StateServer for storing State, but Azure doesn't support that. 我们使用StateServer来存储状态,但是Azure不支持该状态。 We would need to configure either Table storage, SQL Databases, or a Worker role dedicated to State management (a new worker role is an added cost). 我们将需要配置表存储,SQL数据库或专用于状态管理的辅助角色(新的辅助角色是增加的成本)。 Table storage wouldn't be ideal due to performance. 由于性能,表存储不是理想的选择。 The other 2 options are preferable but they introduce cost or app-reconfiguration disadvantages. 其他2个选项更可取,但它们会带来成本或应用程序重新配置的缺点。
  2. We use SimpleMembership for user management. 我们使用SimpleMembership进行用户管理。 We would need to migrate the membership tables from our vm instance sql server to Azure's SQL Databases. 我们需要将成员资格表从vm实例sql服务器迁移到Azure的SQL数据库。 This is an inconvenience as we want to keep all our tables in the same database, and splitting up the 2 may require making some code changes. 这是一个不便,因为我们希望将所有表都保存在同一数据库中,并且将两个表拆分可能需要进行一些代码更改。

We are looking for a quick solution to have this app live as soon as possible, and at manageable cost. 我们正在寻找一种快速的解决方案,以使该应用尽快上架,且费用可控。 We are desperately trying to avoid re-factoring our code just to accommodate hosting part of the app in Azure Cloud services. 我们正拼命地试图避免重构代码,以适应将应用程序的一部分托管在Azure云服务中。

Questions: 问题:

  • Should we just go the VM route for hosting everything? 我们是否应该只是通过VM路由来托管所有内容?
  • Is there any cost benefit in leveraging a VM instance (for sql server) and a Cloud Service instance (for the front-end)? 利用VM实例(用于sql server)和Cloud Service实例(用于前端)是否有任何成本优势?
  • It seems to me every added "background process" to a Cloud Service will require a new worker role. 在我看来,向云服务添加的每个“后台进程”都将需要一个新的辅助角色。 For example, if we wanted to enable smtp for email services, this would require a new role, and hence more cost. 例如,如果我们要为电子邮件服务启用smtp,则这将需要一个新角色,因此需要更多成本。 Is this correct? 这个对吗?

To run SQL Server with CLR etc, you'll need to run SQL Server in a Virtual Machine. 要使用CLR等运行SQL Server,您需要在虚拟机中运行SQL Server。

For the web tier, there are advantages to Cloud Services (web roles), as they are stateless - very easy to scale out/in without worrying about OS setup. 对于Web层,Cloud Services(Web角色)具有无状态的优点-非常易于扩展/扩展,而无需担心操作系统设置。 And app setup is done through startup scripts upon bootup. 在启动时通过启动脚本完成应用设置。 If you can host your session content appropriately, the stateless model will be simpler to scale and maintain. 如果您可以适当地托管会话内容,则无状态模型将更易于扩展和维护。 However: If you have any type of complex installations to perform that take a while (or manual intervention), then a Virtual Machine may indeed be the better route, since you can build the VM out, and then create a master image from that VM. 但是:如果您需要花一些时间(或手动干预)执行任何类型的复杂安装,则虚拟机确实是更好的选择,因为您可以构建VM,然后从该VM创建主映像。 。 You'll still have OS and app maintenance issues to contend with, just as you would in an on-premises environment. 就像在本地环境中一样,您仍然需要解决OS和应用程序维护问题。

Let me correct you on your 3rd bullet regarding background processes. 让我在有关后台进程的第三个项目符号上对您进行纠正。 A cloud service's web role (or worker role) instances are merely Windows Server VM's with some scaffolding code for startup and process monitoring. 云服务的Web角色(或辅助角色)实例只是Windows Server VM的实例,带有一些用于启动和过程监控的脚手架代码。 You don't need a separate role for each. 您不需要每个人都有单独的角色。 Feel free to run your entire app on a single web role and scale out; 随意在单个Web角色上运行整个应用程序并进行扩展; you'll just be scaling at a very coarse-grain level. 您将仅在非常粗糙的级别进行缩放。

Some things to consider... 要考虑的一些事情...

If you want to be cheap, you can have your web/worker role share the same code on a single machine by adding the RoleEntryPoint. 如果您想便宜一些,可以通过添加RoleEntryPoint来让您的网络/工作人员角色在一台计算机上共享相同的代码。 Here is a post that actually shows how to do what you are trying to do with sending email: http://blog.maartenballiauw.be/post/2012/11/12/Sending-e-mail-from-Windows-Azure.aspx 这是实际显示如何处理发送电子邮件的方法的帖子: http : //blog.maartenballiauw.be/post/2012/11/12/Sending-e-mail-from-Windows-Azure。 aspx

Session management is painfully slow in SQL Azure DB, I would use the Azure Cache if you can..it is fast. 会话管理在SQL Azure DB中非常缓慢,如果可以,我会使用Azure缓存。

SQL Server with VMs is going to cause problems for you, because you will also need to create a virtual network between that and any cloud services. 带有VM的SQL Server将为您带来问题,因为您还需要在该VM与任何云服务之间创建一个虚拟网络。 This is really stupid, but if you deploy a cloud service AND a VM they communicate over the PUBLIC LOAD BALANCER causing a potential security concern and network latency. 这确实很愚蠢,但是如果您部署云服务和VM,它们将通过PUBLIC LOAD BALANCER进行通信,从而导致潜在的安全隐患和网络延迟。 So, first you need to virtual network them (that is an extra cost)..then you also need to host a DNS server to address the SQL Server VM. 因此,首先您需要对它们进行虚拟网络连接(这是额外的费用)。然后,您还需要托管一个DNS服务器来对SQL Server VM进行寻址。 Yes this is really stupid, unless you are OK with your web/worker roles communicating with your SQL Server over the internet :) 是的,这确实是愚蠢的,除非您对通过互联网与SQL Server进行通信的web / worker角色感到满意:)

EDIT: changed "public internet" to "public load balancer" (and noted latency) 编辑:将“公共互联网”更改为“公共负载平衡器”(并注明了延迟)

EDIT: The above information is 100% correct contrary to the comment by David below. 编辑:上面的信息是100%正确,与下面的David评论相反。 Please read the guidance from Microsoft here: 请在此处阅读Microsoft的指南:

http://msdn.microsoft.com/library/windowsazure/dn133152.aspx#scenario http://msdn.microsoft.com/library/windowsazure/dn133152.aspx#scenario

DIRECTLY FROM MICROSOFT GUIDANCE speaking about cross Cloud Service communication (VM->web/worker roles): 直接来自MICROSOFT GUIDANCE,它涉及跨云服务通信(VM-> Web / Worker角色):

"We recommend that you implement the first option as the connection process would not need to go through the public Internet. Therefore, it would provide a better network performance." “我们建议您实现第一个选项,因为连接过程不需要通过公共Internet进行。因此,它将提供更好的网络性能。”

As of today (8/29/2013) Azure VMs and Worker/Web Roles are deployed into DIFFERENT "Cloud Services". 截至今天(2013年8月29日),Azure VM和辅助角色/ Web角色已部署到不同的“云服务”中。 Therefore communication between them needs to be secured via a Virtual Network that exposes private IP addresses between the instances. 因此,需要通过一个虚拟网络来保护它们之间的通信,该虚拟网络在实例之间公开私有IP地址。

To follow up on David's point below, that about adding an ACL. 要继续遵循David的观点,即添加ACL。 You are still sending packets over the internet using TDS (SQL Server protocol). 您仍在使用TDS(SQL Server协议)通过Internet发送数据包。 That can be encrypted, but no sane architect/enterprise governance/security governance would "allow" this scenario to happen in a production environment. 可以对其进行加密,但是没有理智的架构师/企业治理/安全治理会“允许”这种情况在生产环境中发生。

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

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