Pacific73 / gorm-cache

gorm v2的即插即用、无需修改代码的旁路缓存。An easy-to-use look-aside cache solution for gorm v2 users.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why use intanceId?

yafacex opened this issue · comments

different process use diffrent instanceId, is it a waste of memory?

To be more accurate, the instance you created can be shared among different processes, since db instance itself can be accessed in different processes because the cache instance is attached to the db instance. The purpose of instance id is to handle the situation where you use 2 cache instances on 2 different db instances while only using 1 shared redis server for caching. in that case, keys would have conflicts if we don't add an instance id prefix before key names for isolating.