The invention discloses a real-
time data caching method and
system of a real-time
database, and relates to the technical field of
computer data storage.The method comprises the steps that a
cache server is started, common data is preloaded, a
data query request is initiated, and whether to-be-queried data exists in the
cache server or not is checked; when the real-time
database data changes, generating a data change event message, and sending the data change event message to a
message queue; monitoring a data change event in the
message queue, and updating data in the
cache server according to an
event type; and determining a cache updating strategy, keeping the consistency of cache data and
database data, implementing cache partitioning and fragmentation, and dynamically adjusting a cache strategy. According to the real-
time data caching method of the real-time database, the query performance and the response speed are improved, the
cold start miss rate is reduced, the
system load is reduced, the
data consistency and timeliness are ensured, the high-frequency and low-
frequency data survival time is optimized, the caching
hit rate is increased, the database writing pressure is reduced, and the overall performance of the
system is improved.