Pacific73 / gorm-cache

gorm v2的即插即用、无需修改代码的旁路缓存。An easy-to-use look-aside cache solution for gorm v2 users.
Apache License 2.0
111 stars 29 forks source link

Why there are two tiers for cache? #19

Closed rts-gordon closed 1 year ago

rts-gordon commented 1 year ago

Hi @Pacific73 I am studying gorm-cache, I noticed there are two tier caches: one is remote Redis, another is local memory. Why design a two-tier cache? This makes the design more complex, will it improve performance?

Can I use the remote Redis only ? or use the local memory only?

Thank you.

Pacific73 commented 1 year ago

They're not like 2-tier relationship, instead you can use redis as cache storage OR local memory. They're EITHER-OR relationship.

rts-gordon commented 1 year ago

Got it. Thanks a lot.