HttpContext.Cache与数据库问题 [英] HttpContext.Cache vs Database question

查看:116
本文介绍了HttpContext.Cache与数据库问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用HttpContext.Cache属性的优点和缺点是什么?与使用数据库?我有很多关于数据库问题的帖子,诸如此类.

What are the benefits and disadvantages to using HttpContext.Cache property. vs using a database? I had many post about database questions and such.

推荐答案

DB的一个明显好处是您的数据并不全部在内存中,而是在DB上服务器.缓存数据的一个明显好处是它已经在内存中,而不是运行需要进行联接和过滤等操作的SQL.但是,总的来说,收益/成本取决于您的Web应用程序的性质,数据的性质,以及您希望拥有多少用户.
One obvious benefit of a DB is that your data is not all in memory, it''s on the DB server. One obvious benefit of caching data is that it''s in memory already, as opposed to running SQL that needs to do joins and filtering, etc. However, in general, the benefits/costs depend on the nature of your web app, the nature if your data, and how many users you expect to have.


这篇关于HttpContext.Cache与数据库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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