There are many caching technologies in use today, such as Redis , Memcache , EhCache , etc., and even ConcurrentHashMap or HashTable is used to implement caching. But when it comes to the use of cache, everyone has their own implementation method, most of which are directly bound to the business code. As the business changes, it is very troublesome to change the cache solution. Next, we will use AOP + Annotation to solve this problem, and use the automatic loading mechanism to achieve data " resident memory ".
The article published in infoq "Faced with caching, what issues need to be considered?" 》
"Re-discussing cache penetration, data consistency and eventual consistency issues"
AOP based on aspectj has been implemented, and the code is in com.jarvis.cache.aop.aspectj.AspectjAopInterceptor. If you want to understand the details by reading the code, you can use this as an entry point.
QQ group: 429274886