In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. Why is the local cache needed in the system:
In the program, some table data is very little, but when the program is loaded, it should be accessed immediately and frequently, such as (such as system configuration parameters, area information). Put the data into the local cache of the program, that is, memory, so as to improve the access efficiency of the system, reduce database access, database access to occupy database connections, while the network consumption is relatively large. But at the same time, we should pay attention to the occupied space of the cache and the invalidation strategy of the cache.
There are two commonly used caches: local cache and distributed cache.
Let's first take a look at why local caching is used, in terms of the differences between databases (such as MYSQL), local caches (such as guava cache), and distributed caches (such as redis):
2. The difference between database, local cache and distributed cache
Database local cache distributed cache storage location save, data loss does not save, previous data loss does not save disk, data loss persistence can
Whether the access speed is slow and the fastest is scalable, but the hard disk of other machines can only have local memory, but there can be memory usage scenarios of other machines that need to be persisted and need to be accessed quickly, but the memory size needs to be considered.
1) Fast access is required, regardless of memory size
2) persistence is required, but some data will be lost
3) caches need to be centralized, and access to data in memory on any machine can be obtained from the cache.
3. Through the comparison above, the local cache can bring better performance to the system, but not too much data and failure strategy should be considered.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.