简体   繁体   English

Windows Azure中的大型会话状态对象

[英]Large session state objects in Windows Azure

I am building an online document editor (think google docs) with Windows Azure. 我正在使用Windows Azure构建在线文档编辑器(想想Google文档)。

I need access to my document object every time a user performs an operation on it (keystroke = word completion, edit text = save, etc.) 每次用户对其执行操作(击键=单词补全,编辑文本=保存等)时,我都需要访问我的文档对象。

The best setup I have been able to come up with so far is to have one or more dedicated cache role(s) in Azure, and retrieve the documents from there from my web role(s). 到目前为止,我能想到的最佳设置是在Azure中拥有一个或多个专用缓存角色,然后从我的Web角色那里检索文档。 However, this means that a document that could take up as much as 10 MB when serialized as JSON would have to be transmitted between the cache role and web role, potentially for each keystroke. 但是,这意味着在序列化为JSON时可能占用多达10 MB的文档将必须在缓存角色和Web角色之间传输,可能是针对每个按键。 It seems like an incredible amount of load to put on the system for a trivial task. 似乎为完成一项琐碎的任务而在系统上施加了难以置信的负载。

What I would rather do is to have the document loaded in memory on the web role that handles the request, but that conflicts with the stateless nature of Azure; 我希望做的是将文档加载到处理请求的Web角色的内存中,但这与Azure的无状态本质相冲突。 it is difficult to do sticky load balancing, the logic for handling a server that crashes is complicated, and the latency benefit of Azure goes out the window if a specific document can only exist on one specific web role (= geographical location). 很难进行粘性负载平衡,处理崩溃的服务器的逻辑很复杂,并且如果特定文档只能存在于一个特定的Web角色(=地理位置)上,则Azure的延迟优势将荡然无存。

Any good ideas for a solution to this? 有解决这个问题的好主意吗?

Try redesigning your design. 尝试重新设计您的设计。 You're right in that what you describe doesn't sound like a scalable approach. 您是对的,因为您所描述的听起来不像是一种可扩展的方法。

Do you really need the document for work completion? 您真的需要文件来完成工作吗? I would think that you could make a call (to a separate REST server) that holds a dictionary to do the word completion. 我认为您可以打电话(到一个单独的REST服务器),该电话持有一个字典来完成单词。 You could build a dictionary for each document if you wanted to autocomplete names and misspelled words too, but even then your dictionary probably would be a lot smaller. 如果您也想自动完成名称和拼写错误的单词,则可以为每个文档构建一个词典,但是即使那样,您的词典可能也会小很多。

as for saves, how often do they happen? 至于节省,它们多久发生一次? automatically or only when the user presses the save button. 自动或仅当用户按下保存按钮时。 You could fetch the document from the database, apply the save and store the result. 您可以从数据库中获取文档,应用保存并存储结果。

that said, it isn't easy to implement your own google docs. 也就是说,要实现自己的Google文档并不容易。

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

相关问题 会话管理Windows Azure - session management windows azure window azure无法向会话状态服务器发出会话状态请求 - window azure Unable to make the session state request to the session state server 如何使用Windows Azure缓存服务在预览中将Linq存储到Sql对象中 - How can I store Linq to Sql objects in session using Windows Azure Cache Service (Preview) Windows Azure上具有多个实例的会话变量 - Session variables with multiple instances on windows Azure 无法序列化会话状态。 在“ StateServer”和“ SQLServer”模式下,ASP.NET将序列化会话状态对象,因此 - Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result 存储大型动态对象而不是会话的另一种方法 - alternate way to store large dynamic objects, instead of session 在 Azure 的 Application Insights 中记录 session state Redis 的缓存 - Logging session state in Application Insights for Azure Cache for Redis 升级到EF6会破坏Azure的通用提供程序会话状态 - Upgraded to EF6 blew up Universal provider session state for Azure 无法将对象加载到 Asp.net 上的 Redis 会话状态提供程序 - Cannot load objects to Redis Session State Provider on Asp.net 如何使用Azure Redis会话状态提供程序在ASP.NET会话中存储集合 - How to store a collection in ASP.NET Session using Azure Redis Session State Provider
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM