Azure 项目 - 需要指导
我正在开发一个小型的介绍性 Azure 项目,我需要以负载平衡的方式在辅助角色之间分发文档。 我是 ASP .NET 和 azure 的初学者。 我想要一些关于如何使用 azure/resources 来做到这一点的想法,这将帮助我做到这一点。
I am working on a small introductory Azure project where I need to distribute documents among the worker roles in a load balanced manner.
I am a beginner in both ASP .NET and azure.
I would like some ideas on how to do this with azure/resources that will help me do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会将文档放入 Azure blob 存储中,并将工作项放入队列中。工作人员会在处理文档时从队列中提取一个条目并将其删除。请记住,如果工作人员失败,您将需要某种方法来重新排队工作。您可以通过在删除队列项目之前重新锁定队列项目来完成此操作,或者使用另一个存储,例如可以定期检查并用于重新排队失败项目的表条目。
I would put the documents into Azure blob storage an put a work item in a queue. The workers would pull an entry from the queue and delete it while they process the document. Just keep in mind that if a worker fails, you'll want some way to re-queue the work. You could do this by reknewing the lock on the queue item before deleting it, or by using another store, say a table entry that you can check perioically and use to requeue failed items.
我建议您首先阅读 Azure 队列存储 (队列服务 API< /a>)。通过将消息插入队列,辅助角色可以尽可能地从该队列中获取工作。队列中条目的大小限制为 8KB,因此我建议您将该实际文档放入 SQL Azure(如果您的应用程序正在使用它)或 Azure BLOB 存储 (Blob 存储 API),并在队列上发布一条消息,其中包含对所存储文档的引用。
I'd recommend that you start by reading up on Azure Queue Storage (Queue Services API). By inserting messages into a queue, worker roles can take work from that queue as they are able. The size of an entry on a queue is limited to 8KB, so I'd recommend that you put that actual document in SQL Azure (if your application is using it) or Azure BLOB Storage (Blob Storage API) and post a message on the queue that contains a reference to the stored document.
开发云应用程序指南是一个很好的学习资源以及 Microsoft 模式和示例应用程序实践。
A good learning resource to start with is the Developing Application for the Cloud guide and a sample app from Microsoft patterns & practices.