简体   繁体   English

MongoDB在Azure上的角色

[英]MongoDB on Azure worker role

I m developing an application using SignalR to manage websockets and allow my clients to dialog between each other. 我正在使用SignalR开发一个应用程序来管理网络套接字,并允许我的客户端彼此对话。

I m planning to host this back-office on an Azure worker role. 我打算将此后台托管在Azure工作者角色上。 As my SignalR requests carry data that is most of the time saved in the database, I m wondering if NoSQL's MongoDB instead of the classic SQL Server/Entity Framework couple should be a good approach. 由于我的SignalR请求所携带的数据大部分时间都保存在数据库中,所以我想知道NoSQL的MongoDB而不是经典的SQL Server / Entity Framework对应该是一个好方法。

Assuming that my application's data types will be strings for most of them, I think MongoDB will be a reliable and a performant solution, and it will allow me to get rid of Azure's SQL's database costs. 假设我的应用程序的数据类型将是其中大多数的字符串,我认为MongoDB将是可靠且高性能的解决方案,它将使我摆脱Azure的SQL的数据库成本。

For information, the Azure worker role will be running on a machine with the following hardware: 1 core CPU, 3.5GB RAM and 50GB SSD storage. 有关信息,Azure worker角色将在具有以下硬件的计算机上运行:1个核心CPU,3.5GB RAM和50GB SSD存储。

Do you think I m on a good start with this architecture ? 您认为我在这种体系结构方面有良好的开端吗?

Thanks 谢谢

Do you think I m on a good start with this architecture? 您认为我从这个架构开始吗?

In a word, no. 一言以蔽之。

A user asked a similar question regarding running Redis on Worker Roles - Setting up Redis on Azure cloud service worker role - all of the content on that Q/A is relevant in the MongoDb context. 用户询问有关在角色上运行Redis的类似问题- 在Azure云服务工作者角色上设置 Redis-该Q / A上的所有内容都与MongoDb上下文相关。

I'd suggest that you read my answer as it goes into more detail, but as an overview of why this is a bad architectural approach: 我建议您仔细阅读我的答案,但要概述为什么这是一种不良的架构方法:

  1. You cannot guarantee when a Worker Role will be restarted by the Azure Service Fabric. 您不能保证Azure Service Fabric将何时重新启动工作角色。
  2. In a real-world implementation of Mongo, you would run multiple nodes within a cluster, with a single Worker Role (as you have suggested in your question) this won't be possible. 在Mongo的实际实现中,您将在一个集群中运行多个节点,并且只有一个Worker角色(如您在问题中所建议的),这是不可能的。
  3. You will need to manage your MongoDb installation within the Worker Role and they simply aren't designed for this. 将需要在辅助角色中管理您的MongoDb安装,而它们并不是为此而设计的。

If you are really fixed on using Mongo, I would suggest that you use a hosted solution such as MongoLabs (as suggested in earlier answers), or consider hosting it on Azure IaaS VM's. 如果您真的确定要使用Mongo,建议您使用托管解决方案,例如MongoLabs(如先前答案中所建议),或考虑将其托管在Azure IaaS VM上。

If you are not fixed on using Mongo, I would sincerely suggest that you look at Azure DocumentDb (also suggested above), Microsoft's Azure NoSQL offering - I have used it in several production systems already and it is certainly a capable NoSQL solution; 如果您对使用Mongo不满意,我会真诚地建议您查看Microsoft的Azure NoSQL产品Azure DocumentDb(也在上面建议)-我已经在多个生产系统中使用过它,并且它肯定是一个功能强大的NoSQL解决方案; granted, it may not have all of the features available with MongoDb. 当然,它可能不具有MongoDb的所有可用功能。

If you are looking at a NoSQL solution for caching of data (ie not long term storage), I would suggest you take a look at Azure Redis Cache, which is a very capable Redis offering. 如果您正在寻找一种用于数据缓存(即长期存储)的NoSQL解决方案,我建议您看一下Azure Redis Cache,它是功能非常强大的Redis产品。

Azure has its own native NoSQL Document database called DocumentDB , have you had a look at it? Azure有自己的本地NoSQL Document数据库,称为DocumentDB ,您是否看过它? If I were you I would use DocumentDB unless there are some special requirements that you have that you have not mentioned, but from what little requirement info that you have posted DocumentDB would do just fine. 如果您是我,我将使用DocumentDB,除非您有一些未提到的特殊要求,但是从您发布DocumentDB的一点要求信息中就可以了。 I don't think that it is quite similar to MongoDB in terms of the basic functionality, see this article for a comparison between Azure DocumentDB and MongoDB . 在基本功能方面,我认为它与MongoDB不太相似,请参阅本文以了解Azure DocumentDB和MongoDB之间的比较

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

相关问题 在Azure工作者角色中的DbConfiguration.SetConfiguration - DbConfiguration.SetConfiguration in azure worker role 连接到sql azure的worker角色随机错误 - worker role random errors connecting to sql azure Microsoft.SqlServer.Types在Azure辅助角色上无法正常运行 - Microsoft.SqlServer.Types not functioning properly on Azure Worker Role EF6和Azure工作者角色:基础提供程序在打开时失败 - EF6 and azure worker role : underlying provider fail on open 如何将实体框架作为 Azure 辅助角色部署的一部分? - How do I include Entity Framework as part of my Azure Worker Role deployment? 在针对SQL Azure的Azure Worker角色中将EF5 Code First和Unity IoC一起使用时,“底层提供程序在打开时失败”错误 - “The underlying provider failed on Open” Error when using EF5 Code First with Unity IoC in Azure Worker Role against SQL Azure 在工作角色中缓存域对象 - Caching domain objects in worker role 实体框架在工作者角色中的DbContext生命周期 - Entity Framework's DbContext Lifetime in Worker Role Azure Web角色在部署时开始 - Azure web role start on deploy Azure Web角色中的实体框架DbContext - Entity Framework DbContext in Azure Web Role
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM