1

Johnny cache is good for table of readonly data or seldom updated data, like game meta table. It got table level versioning which will auto expire query cache on the target table if an update happens on it.

For an SNS like application, UGC can usually be sharded by user_id and cache are usually done on per-user level, so I'm thinking of change the auto-versioning mechanism from table level to a user level, for example, for table level, a key conceptually would look like

"jc _ {table name} _ {table version} _ {query hash}"

for a user level key it would like

"jc _ {table name} _ {"table + {userid}" _ version} _ {query hash}"

which is imagining that the cache is done on a view of the table for a specific user (considering the view of "select * from table where user_id=111" as the table for johnny-cache to work on). Then it can be used to cache most of the UGC in an uniformed way.

I understand no silver bullet for all problems but for this proposal can you share any info or recommendation with me? thanks in advance.

Jason Xu
  • 2,903
  • 5
  • 31
  • 54

0 Answers0