Because, according to the needs of the project, caching services are required, and some data does not need to be written to the database, but the data needs to be calculated and processed
At the beginning, it is written to memory, but this disadvantage is that after IIS is restarted, all the data in memory is lost
So, we store data in REDIS, and even if IIS goes down, we don't have to worry about data loss
I refer to many redis methods encapsulated by others on the Internet, and some of them are not suitable for me, so I encapsulated a redishelper method by myself
I also wrote a demo, which is to add data to redis in batches and take out all the data of redis
Demo source code download:
Tourists, if you want to see the hidden content of this post, please Reply
|