1: write directly into the json file (very convenient but unsafe)
2: write the database, then use Redis for cache (currently using this)
3: global variables, global variables to cache the content in the Redis
Want to use the third method, because the second method will result in frequent access to Redis, don't know the third way is there any problem! Or how is everyone?
CodePudding user response:
Constant put memory, generally do multistage cache, no special performance, of course, the second scheme is also no problem.Redis bottleneck I only in the export data, some fields according to the code name mapping, the similar article data checked redis hundreds of thousands of times... Memory is much faster