会话,缓存,SQL缓存或其他什么? [英] Session, cache, sql cache or what else?

查看:72
本文介绍了会话,缓存,SQL缓存或其他什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要您的帮助以了解性能/可伸缩性问题.

我必须维护一个仅在社会网络中运行的Web应用程序,该应用程序是批准的工作流管理器",并且还用于存储文档.

框架是4.0,语言是C#,服务器是sql2005服务器

该应用程序大约有500个用户,通常我认为同一时间不会超过100个用户.

我遇到翻译问题,发现的情况是要翻译的sql表,在基础函数的代码中,隐性函数后面的代码查找每个控件并使用sql中的一个.

好吧,每个页面都加载,因此每次都请求相同的字符串",
所以我决定将整个翻译表存储在session
注意:表中包含3种语言,少于1000种翻译,因此总计3.000.
注意2:我现在正在开发仅保留实际语言的系统,因此数据总量可以变成1.000行

您认为在线存储与100个用户的会话中的3000条记录是否很容易?

可以将其存储在Cache中是更好的解决方案吗?


还有其他聪明的主意吗? :D

谢谢
bye bye

hi Guys,

i need your help to understand a performance /scalability problem.

I have to mantain a web-application that runs only in the society network, the application is an "approval workflow manager" and it is used also to store documents.

The framework is 4.0, the language is C#, the server is a sql2005 server

The application has about 500 users, and usually i think no more then 100 user at the same time.

I''m facing a problem with translations, the situation i found is a sql table for the translation, and in the base-page ''s code behind a recoursive functions that look for every controls and change the description of the text with the one in the sql.

Well every page load so make requests for the same "string" every time,
so i decided to store the whole translation table in session
Note: the table count 3 language, less than 1000 translation so 3.000 at total.
Note 2: i''m developing right now the system to keep only the actual language so the total amount of data could become 1.000 rows

do you think that could be paintfull to store 3000 records in session with 100 users online ?

could store in Cache be a better solution ?


any other smart idea ? :D

thanks
bye bye

推荐答案

由于翻译表将由所有用户共享,如果我正确理解,为什么不将表存储在Application对象内而不是Session对象.那么将只有一个实例.如果您的转换表中有一些整数键,并且始终通过该键获取内容,则您还可以将所有数据读入Dictionary<int, String>中以便快速检索.

希望对您有所帮助!

问候,

Manfred
Since the translation table would be shared by all users, if I understood you correctly, why not store the table inside the Application object instead of the Session object. Then there would be only one instance. If there is some integer key to your translation table and the content is always fetched via this key you could also read all of your data into a Dictionary<int, String> for fast retrieval.

Hope that helps!

Regards,

Manfred


与100位用户在线的会话中有3000条记录
在给定的时间,在会话中听起来确实有太多数据.

我会选择Cache-在这里会是更好的选择.

阅读以下内容:
MSDN:ASP.NET缓存:技术和最佳实践 [ ASP.NET中的缓存管理 [
3000 records in session with 100 users online
That does sounds too much of data in a session at a given time.

I would go with Cache - it would be better option here.

Have a read of the following:
MSDN: ASP.NET Caching: Techniques and Best Practices[^]
Cache Management in ASP.NET[^]


UPDATE:
After reading Manfred answer and then question again, it does sounds like sharing a data across user. In that case, Application variables fit the bill best.


这篇关于会话,缓存,SQL缓存或其他什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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