
go 如果引入第三方内存缓存库的话,引入哪个好? 之前有用过,后来觉得有些使用场景比较小就改成 sync.map 了 ,现在用的场景有点多了。想要引入个质量高一点的第三方内存缓存库
1 FrankAdler Jul 17, 2025 |
2 Ayanokouji Jul 17, 2025 |
3 ripperdev Jul 17, 2025 https://github.com/hashicorp/go-memdb 最近在用这个,consul 家出的 |
4 cannotagreemore Jul 17, 2025 我司大规模项目在用,自研 sdk 也集成了这个实现,设计和文档质量都还不错 https://github.com/hypermodeinc/ristretto |
5 Reficul Jul 17, 2025 |
6 lepig Jul 17, 2025 卧槽 5 个回复,5 个库。OP 岂不是更加就纠结了 |
7 jenner1331 Jul 17, 2025 anycache |
8 LinusWong Jul 17, 2025 这就是 go 吗,太百花齐放了 |
9 Verdure Jul 17, 2025 |
10 wkzq Jul 17, 2025 |
11 Aug Jul 17, 2025 选活跃的 |
12 cooltechbs Jul 17, 2025 @LinusWong 碎片化哈哈哈 |
13 me262 Jul 17, 2025 楼上推荐的这些应用场景都不一样,用 ai 对比一下 |
15 Rehtt Jul 17, 2025 根据需求自己搓一个 |
16 csfreshman Jul 17, 2025 百花齐放百家争鸣 |
17 dabaibai Jul 17, 2025 直接来个性能对比图 让大家选 |
18 beihanggmj Jul 17, 2025 @lepig #6 |
19 ChunkitAu Jul 17, 2025 go-cache +1 使用也简单,当然看你项目规模,规模小 go-cache 足够使用了 |
20 craftsmanship Jul 17, 2025 via Android Mode Python 笑而不语 |
21 PungentSauce OP 我忘记之前用过 go-cache 还是 big-cache 了。 性能和功能性两方面吧。好多第三方 cache 不支持按照 key 进行过期设置就比较麻烦。 |
22 me221 Jul 17, 2025 让我惊讶的是几个库的更新时间已经是几年前了? go-cache: 6 years ago btree: 11 months ago Go 的兼容性这么好嘛 |
23 chimission Jul 17, 2025 @me221 go1.x 的更新开发者保证都是向后兼容的, 但是不保证以后得 go2 |
24 chimission Jul 17, 2025 我以前也是用的 go-cache 简单够用, 唯一不足就是不更新了,不过这个库做内存缓存也够了,更新不更新无所谓 |
25 matrix1010 Jul 17, 2025 @cannotagreemore 你司要不要考虑换一换?建议看看 https://news.ycombinator.com/item?id=44414630 。作为 Theine 的作者我向你推荐 otter |
26 nanrenlei Jul 17, 2025 |
27 wnanbei Jul 17, 2025 @chimission 已经没有 Go2 咯,只会有 1.xxx |
28 noyidoit Jul 17, 2025 go-cache+1 ,简单够用 |
29 looplj Jul 17, 2025 @matrix1010 #25 v2 大佬真多,我在用 theine ,还提过 issue 来着 |
30 StarUDream Jul 17, 2025 |
31 wervserwe Jul 17, 2025 自己根据需求写个 |
32 litchinn Jul 17, 2025 |
33 spiritfelix Jul 18, 2025 看需求吧,我甚至用了 SQLite 做本地数据存储,目的是有些数据,关闭应用继续保留,开启应用继续使用,哦,忘了说,Wails 桌面端应用 |
34 qloog Jul 20, 2025 https://github.com/hypermodeinc/ristretto 这个就很不错,各方面指标都很不错 ristretto 详细对比: https://hypermode.com/blog/introducing-ristretto-high-perf-go-cache 里面也提到了关于性能提升的一些关键点和参考,也有一些性能对比的参考图 作为 local cache 使用的案例: https://github.com/go-eagle/eagle/blob/master/pkg/cache/memory.go |
35 qloog Jul 20, 2025 @Ayanokouji 看到 grafana 也在使用 otter |
36 RedisMasterNode Jul 21, 2025 |
38 815979670 Jul 21, 2025 |
39 gongym Jul 22, 2025 我记得我之前也做过选型,后来选了 redis |