The invention discloses a cache updating method and a
system based on Canal. The cache updating method based on Canal comprises the following steps: S1, an updating diary is generated after a databasechanges a
data field, and the updating diary includes a change value of the
data field; S2, reading the
database by Canal to obtain the update diary; S3, parseing the update journal by Canal to obtain the change value, and sending the change value to the
message queue; S4, receiving and sending the change value to the message consuming end by the
message queue, receiving and sending the change value to the cache by the message consuming end, and updating the change value by the cache. The invention utilizes Canal and
message queue, When updating the saved data in the
database, the changes ofthe data is timely and accurately monitored, and the updated data is updated in the cache synchronously, so as to avoid the defect of excessive load on the
database caused by constantly querying the database, improve the updating frequency of the cache, and further improve the
server and the reading speed of the cache.