如何管理在.net中大的序列化数据对象 [英] how to manage large serialized data object in .net

查看:142
本文介绍了如何管理在.net中大的序列化数据对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大(20-30 MB)序列化数据对象(从Excel序列数据)输入我的.NET应用程序。当用户通过Web服务请求时,我需要根据用户的输入,以及从序列化对象的数据处理输出。

I have large (20-30 MB) serialized data object(data serialized from excel) as input for my .net application. Whenever user request through webservice, I need to process output based on user input as well as the data from serialized object.

这是存储在.NET应用程序(缓存/会话/应用对象),这些对象的有效途径?由于这些序列化的数据对象的变化在3年或4倍。我不希望每次这些序列化对象的数据加载到内存中,当用户请求发送到webserivce。

Which is the effective way to store these object in .net application (cache/session/application object)? Because these serialized data object changes 3 or 4 times in a year. I don't want to load these serialized object data into memory each time when user request send to webserivce.

我也想知道这些对象如何被存储在内存和磁盘,以便它不会占用太多的内存空间,以及磁盘空间。

推荐答案

使用的静态的变量来存储序列化对象。正如你所提到的序列化对象有一个全球范围的,所以不要在会话中存储,因为它的用户/会话的。此外,我们经常存储大多采用,并在定​​期更新,但正如你所说,将被更新3-4次,一年在高速缓存中的项目,所以缓存并不是一个很好的选择在这里IMO。

Use static variable to store serialized object. As you mentioned the serialized object has a global scope, so don't store in session as it is user/session. Also we often store items in cache that are mostly used, and updated in regular intervals but as you mentioned it will be updated 3-4 times in a year, so Cache is not a good candidate here in IMO.

这篇关于如何管理在.net中大的序列化数据对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆