简体   繁体   English

在内存中缓存10万条记录的最佳方法是什么

[英]What is best way to cache 100k records in memory

为了进行身份验证,我需要缓存诸如用户名,密码之类的记录,缓存该数据是否可行?

A caching platform is partially specific to the platform and language you want to use, for example if you want to c# then something like MemoryCache is a good choice. 缓存平台部分特定于您要使用的平台和语言,例如,如果您要使用c#则诸如MemoryCache东西是一个不错的选择。

However if you are looking to cache your entire set of user data, then maybe its worth considering something different than a cache, maybe try and speed up access to your data store, look into a NoSQL store, or a memory optimized SQL Table. 但是,如果您要缓存整个用户数据集,那么也许值得考虑与缓存不同的东西,也许尝试加快对数据存储的访问,查看NoSQL存储或内存优化的SQL表。

Caching is great when a single item is retrieved lots of times, but not so awesome when lots of data is retrieved a very little amount (ie a user account). 当多次检索单个项目时,缓存非常好,但是当检索少量数据(即用户帐户)时,缓存就不那么棒了。

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

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