Cache data production services workflow analysis
(1) listen to multiple kafka topic, each kafka topic corresponds to a service (simplified look, listen for a kafka topic)
(2) If a service data change has occurred, then it sends a message to kafka topic in
(3) Production of buffered data to monitor the message after it sends a request to the corresponding service call interface and pull data, in this case, the query from the mysql
After (4) to cache data production services to pull data, writes data in a local cache, it is in ehcache
(5) simultaneously writes the data in a redis in
Each layer cache in a highly concurrent scenarios, has its own special purpose, multi-level cache utilization required to support a wide variety of special circumstances to live under high concurrency scenarios
Services local heap cache, action to prevent the complete collapse of redis layer, as a last line of defense cache, avoiding the database directly streaking
spring boot + mybatis + redis integration framework built