1. One of the main functions of redis is to do caching, which solves the problem of high concurrency.
2. If the problem is that the amount of data is huge and the mysql processing time is long, you can only optimize mysql, which has nothing to do with redis.
3. If you hit the cache to redis after processing mysql data, this is actually possible. For example, the sum of daily, monthly or annual data is saved in redis and the data is fetched from redis, but the problem that may arise is that when the cache policy fails, the request will be called into mysql, so that the request will actually slow down.
4. Another solution is to create a statistical table, which is dedicated to statistical data. Run scripts to update the data regularly, and the data is taken from this statistical table. In this way, in fact, data requests will be faster, the principle and redis are not much.
5. Redis is a database in the form of key:value. For value, redis does not have any calculation method, because you cannot determine the value type of value. Generally, the award value is taken out by itself and calculated manually.
Previous: What is the difference between os.exit () runtime.Goexit () return in golang
Next: How to solve the error report of the project created by vue-cli3?