简体   繁体   English

.Net 4.0在SqlServer数据库中缓存数据,而不是在内存中缓存

[英].Net 4.0 Caching Data in SqlServer Database Rather In memory Caching

I know that Microsoft has given System.Runtime.Caching name space in .net 4.0 framework. 我知道Microsoft在.net 4.0框架中给了System.Runtime.Caching命名空间。 This helps us very good in terms of In Memory Caching data ( by using MemoryCache class). 这在内存缓存数据方面(通过使用MemoryCache类)对我们非常有帮助。 But Like enterprise library, it supports the Data Base Caching as well. 但是像企业库一样,它也支持数据库缓存。 I need to know that how to do my data caching (just to put and pic data) in sqlserver db, using the new feature introduced by microsoft. 我需要知道如何使用Microsoft引入的新功能在sqlserver db中进行数据缓存(仅用于放置和图片数据)。 I have gone through, but could not find any article which gives any example through code. 我已经看完了,但是找不到任何通过代码给出任何示例的文章。 Please if any one know let me know. 如果有人知道,请告诉我。

More over if some body can suggest a db model for this in example. 在示例中,是否还有一些机构可以建议使用db模型。

Its more a question of where you need this data and how often you'd have to go to an "expensive" resource to get it. 它更多的是关于您在何处需要这些数据以及必须多久使用一次“昂贵”资源来获取它的问题。

For instance if you have data from a 3rd party site, you could 'cache' that data within your own database, giving you much faster access to it. 例如,如果您有来自第三方网站的数据,则可以在自己的数据库中“缓存”该数据,从而可以更快地访问它。

If you have data from your own database, that is "expensive" to produce or process, you could also cache that data in memory on your web tier. 如果您有自己数据库中的数据,这对生产或处理来说“很昂贵”,那么您也可以将该数据缓存在Web层的内存中。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM