ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

关于Redis的一些思考

2020-03-12 15:03:26  阅读:254  来源: 互联网

标签:cache Redis application outside 关于 思考 data store


1、从Java语言考虑,已经有ConcurrentHashMap等并发集合类了,与Redis相比,区别于差异在哪?

一直有这么个疑问,今天有搜了很久,很巧,搜到个有同样想法的问答,如下:

When profiling a java application currently under development at work, we have detected a few bottle necks that we can get rid of using caching. The application process requests and it should be as fast as possible doing so. We are considering Redis as cache solution because we already use it in the application. Basically we have to cache java objects. With Redis we have to serialize / deserialize those objects + network overhead. Given that basically Redis is a key value store, I was wondering if it may be more efficient to use a ConcurrentHashMap instead of Redis, as that will save us the serialization and network overhead. However, searching in the internet, I could not find anyone using it for this purpose. Am I missing something? Which is the practical limit of the ConcurrentHashMap for this purposes (in terms of concurrent requests and cached data volume)?

asked Dec 4 '13 at 13:39 joanlofe

回答的很明显,也好理解:Redis不只是用作字典缓存的,它还可以用于线程之间共享数据;一想还真是,高并发访问的系统/服务肯定要搞集群,多节点之间的数据共享就体现除Redis的价值了。

还有一个帖子:

Generally, the Guava or Caffiene caching utilities are applicable whenever:

· You are willing to spend some memory to improve speed.

· You expect that keys will sometimes get queried more than once.

· Your cache will not need to store more data than what would fit in RAM. (Guava caches are local to a single run of your application. They do not store data in files, or on outside servers. If this does not fit your needs, consider some other tool.)

As it says they do not store data in files or outside servers, then a popular and modern outside server option could be redis.

标签:cache,Redis,application,outside,关于,思考,data,store
来源: https://www.cnblogs.com/code-indigo/p/12469265.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有