This is the second day of my participation in the More text Challenge. For more details, see more text Challenge
Recently, while looking at the company’s code, I found an unfamiliar place -> listen to events, and I will talk about it
First of all, under the said Why do you want to get this listen, because our system at the time of launch a loading process, is to all rules in the library table type load data into local cache, yi, do things well, this guy general data, why put local, ok I love to learn, to turn over the SVN on the performance of the document.
This is a digression:
– Why do you put a local cache when the server has to back up a copy? Don’t put redis; A solution to all, I’m sorry, the elder people constantly after test and analysis results, because we are the China project, the main processing operation is rule analysis, if the rules in the cache on the redis, since each analysis need to request network data, a fine, than a file there are ten thousand data, So we’re going to have to ask the network 10,000 times, there’s nothing we can do about it, and most of that time is going to be spent requesting the data, not analyzing the data that we want to do, and as I said before, we’re a middle station project, and that’s mainly about analyzing the data.
Ehcache: Ehcache: Ehcache: Ehcache: Ehcache: Ehcache: Ehcache: Ehcache: Ehcache
EhCache is a pure Java in-process caching framework that is fast and lean. EhCache is Hibernate’s default CacheProvider
The official is very confident to use the most widely used cache, I am afraid of machine error, specially turned to English to have a look
JAVA ‘S MOST WIDELY – informs the CACHE
The main features are:
1. Quick
2. Simple
3. Multiple cache policies
4. There are two levels of cached data: memory and disk, so there is no need to worry about capacity
5. The cached data will be written into disks during the VM restart
6. Distributed cache can be implemented through RMI and pluggable apis
7. Listening interface with cache and cache manager
8. Support for multiple cache manager instances, and multiple cache areas for one instance
9. Provide Hibernate caching implementation
It’s a very friendly for single use, use it after all Hibernate, (may all be mybatis refresh, ha, ha, ha), one might ask, how to ensure data consistency problem, therefore, I have to consult with the bosses, big home is very simple, there is no guarantee that consistency, just for the update is not commonly used, There’s going to be a server to handle it. Cache consistency is a big issue and as the rule logic increases, it’s going to move towards distributed caches.
May be don’t understand my idea, since the big trend is distributed, why ehcache, because the official home page has given, but I guess a lot of people don’t know this, technical services in the business, not the best, the latest is like to fall in love, suitable is the best, is also, for example, we also use the mq, but…
We subscribe and publish with Redis, yeah, you see, I have both, I just don’t play by the rules, yeah; Just play!!
Finally, all the technology selection is determined by many times of testing, so the selection must be the optimal solution for the special environment;
The official document has a very detailed tutorial, so this time is not a case, this is just an exploration, but also an optional parameter of technology selection, let’s learn!! Got caught in the cache. Next time, listen
* * * * * * ** * * * ** * * * *Scatter flower end ************* * * * * * * * *