Automatic data caching method and system based on redis
A data caching and caching technology, which is applied in the computer field, can solve problems such as inability to obtain the latest data from query statements, affect business, and the appearance of dirty data, so as to improve the efficiency and quality of data caching, query efficiency, and development efficiency.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0038] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a redis-based automatic data caching method of the present invention includes the following steps:
[0039] Step S10, use mybatis as the persistence layer; inherit the ServiceImpl class in the business layer (such as UserService and UserServiceImpl), and set the annotation of the ServiceImpl class; the annotation includes starting the cache (CacheEnable) and clearing the cache (CacheClear); during specific implementation, It also inherits the IService interface to realize the paging function; annotation (Annotation), also known as Java annotation, is an annotation mechanism introduced by JDK5.0, and classes, methods, variables, parameters, and packages in the Java language can be annotated;
[0040] Step S20, setting the cache name generation strategy (ServiceKeyGenerator) for starting the cache and clearing the cache;
[0041] Step S30, when calling the query method or the addition, deletion and...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 

