cached-query

command
v1.0.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 11 Imported by: 0

README

缓存化数据查询示例

运行 make up 后执行 make example-cached-query。示例使用 SQLite 保存权威商品数据, 使用 Genesis 本地缓存保存查询结果,并使用 Redis dlock 保护同一热点 key 的缓存重建。

首次读取会访问数据库并回填缓存;后续读取命中缓存,最终输出的数据库读取次数应为 1。 锁持有者在重建前后都检查缓存,避免等待锁的请求再次穿透到数据库。

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL