阿神2017-04-18 10:49:07
1. Multiple servers can be on the intranet.
2. Redis can set up a large amount of memory, which means that the amount may not be reached by java.
3. Also, redis can maintain data continuity. For example, if your java is restarted or your java needs If you re-publish, then the data in the memory will no longer exist. This problem does not exist with redis.
4. Moreover, redis is more reliable. The data in redis can be deposited to the hard disk and can be recovered. How do you recover the things in your java memory?
5. A very simple problem is that, for example, the session is stored in the memory, which means that if you re-publish, all users will have to log in again. Redis will not have this problem.
6. For another example, if you have more than N gigabytes of hot data that need to be stored in memory to facilitate efficient reading, can you tell me to use Java memory?
黄舟2017-04-18 10:49:07
1. Different application scenarios lead to multiple deployment methods for redis. Local or cross-machine caching depends on the problem to be solved. For example, if a business program consumes a lot of CPU, the deployed machine only needs a general memory configuration. The cached data is relatively large and needs to be deployed separately or even multiple units to form a cluster. For another example, as the system becomes larger, various modularizations and microservices are required. Each service can evolve independently. Separation of computing and data is also a common method. In addition, there is no need to worry about the overhead caused by network IO. Before the network bandwidth bottleneck is reached, network IO is not a problem. The delay is at the ms level, which is very cost-effective.
2.Redis also has persistence function as a cache and kv database, and can be restored after power outage and restart. Of course, if you just need the caching mechanism, you can choose to program and maintain a cache yourself, depending on your own needs. The price is that you have to implement the caching mechanism yourself, automatic invalidation, cache full and other functions.
大家讲道理2017-04-18 10:49:07
MongoDB also has a pure memory storage engine, which you can also learn about and try out.
Love MongoDB! Have Fun!
I am very curious. The Redis issue was submitted to the MongoDB forum. I also informed that MongoDB also has a similar pure memory storage engine. Some friends expressed dissatisfaction and subtracted 1.
------------------------Gorgeous separator--------------------- ----------
MongoDB Chinese community has many offline activities, please click below:
2017 Huashan Sword Discussion|MongoDB Chinese Community
Hangzhou Station is coming in March! ! ! Interested friends please sign up quickly! ! !