go 如果引入第三方内存缓存库的话,引入哪个好? 之前有用过,后来觉得有些使用场景比较小就改成 sync.map 了 ,现在用的场景有点多了。想要引入个质量高一点的第三方内存缓存库
go 如果引入第三方内存缓存库的话,引入哪个好? 之前有用过,后来觉得有些使用场景比较小就改成 sync.map 了 ,现在用的场景有点多了。想要引入个质量高一点的第三方内存缓存库
|
FrankAdlerJul 17, 2025
1
|
|
2
|
|
ripperdevJul 17, 2025
3
https://github.com/hashicorp/go-memdb 最近在用这个,consul 家出的
|
|
cannotagreemoreJul 17, 2025
4
我司大规模项目在用,自研 sdk 也集成了这个实现,设计和文档质量都还不错
https://github.com/hypermodeinc/ristretto |
|
ReficulJul 17, 2025
5
|
|
6
卧槽
5 个回复,5 个库。OP 岂不是更加就纠结了 |
|
jenner1331Jul 17, 2025
7
anycache
|
|
8
这就是 go 吗,太百花齐放了
|
|
VerdureJul 17, 2025
9
|
|
wkzqJul 17, 2025
10
|
|
AugJul 17, 2025
11
选活跃的
|
|
cooltechbsJul 17, 2025
12
@LinusWong 碎片化哈哈哈
|
|
me262Jul 17, 2025
13
楼上推荐的这些应用场景都不一样,用 ai 对比一下
|
|
RehttJul 17, 2025
15
根据需求自己搓一个
|
|
csfreshmanJul 17, 2025
16
百花齐放百家争鸣
|
|
dabaibaiJul 17, 2025
17
直接来个性能对比图 让大家选
|
|
beihanggmjJul 17, 2025
18
@lepig #6 😇😇😇
|
|
ChunkitAuJul 17, 2025
19
go-cache +1 使用也简单,当然看你项目规模,规模小 go-cache 足够使用了
|
|
craftsmanshipJul 17, 2025 via Android
20
Mode Python 笑而不语
|
|
21
我忘记之前用过 go-cache 还是 big-cache 了。 性能和功能性两方面吧。好多第三方 cache 不支持按照 key 进行过期设置就比较麻烦。
|
|
me221Jul 17, 2025
22
让我惊讶的是几个库的更新时间已经是几年前了?
go-cache: 6 years ago btree: 11 months ago Go 的兼容性这么好嘛 |
|
23
@me221 go1.x 的更新开发者保证都是向后兼容的, 但是不保证以后得 go2
|
|
chimissionJul 17, 2025
24
我以前也是用的 go-cache 简单够用, 唯一不足就是不更新了,不过这个库做内存缓存也够了,更新不更新无所谓
|
|
25
@cannotagreemore 你司要不要考虑换一换?建议看看 https://news.ycombinator.com/item?id=44414630 。作为 Theine 的作者我向你推荐 otter
|
|
nanrenleiJul 17, 2025
26
|
|
wnanbeiJul 17, 2025
27
@chimission 已经没有 Go2 咯,只会有 1.xxx
|
|
noyidoitJul 17, 2025
28
go-cache+1 ,简单够用
|
|
loopljJul 17, 2025
29
@matrix1010 #25 v2 大佬真多,我在用 theine ,还提过 issue 来着
|
|
StarUDreamJul 17, 2025
30
|
|
wervserweJul 17, 2025
31
自己根据需求写个
|
|
litchinnJul 17, 2025
32
|
|
spiritfelixJul 18, 2025
33
看需求吧,我甚至用了 SQLite 做本地数据存储,目的是有些数据,关闭应用继续保留,开启应用继续使用,哦,忘了说,Wails 桌面端应用
|
|
qloogJul 20, 2025
34
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 |
|
qloogJul 20, 2025
35
@Ayanokouji 看到 grafana 也在使用 otter
|
|
RedisMasterNodeJul 21, 2025
36
|
|
815979670Jul 21, 2025
38
|
|
gongymJul 22, 2025
39
我记得我之前也做过选型,后来选了 redis
|