如何管理在.net中大的序列化数据对象中大、对象、序列化、数据

2023-09-03 08:08:26 作者:泪水打湿了双瞳﹌

我有大(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.

 
精彩推荐
图片推荐