Database access method and device with read-write separation
A read-write separation and database technology is applied in the field of database access methods and devices with read-write separation, and can solve the problems of low query result accuracy, inconsistent latest data, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0032] figure 1 It is a flow chart of the database access method with read-write separation provided in Embodiment 1 of the present invention. The embodiment of the present invention aims at the fact that in the prior art, when the synchronization delay between the slave database and the master database is relatively large, the data read from the slave database is inconsistent with the latest data in the master database, and finally the query provided to the user As a result, the problem of low accuracy rate provides a database access method that separates reading and writing. Such as figure 1 , the specific steps of the method are as follows:
[0033] Step S101, before executing the data reading operation instruction, determine whether the slave database is in a synchronization delay state.
[0034] Wherein, the data read operation instruction includes the latest storage time of the target data to be queried.
[0035] In practical applications, when receiving the data que...
Embodiment 2
[0058] figure 2 It is a flow chart of the database access method with read-write separation provided in Embodiment 2 of the present invention. On the basis of the first embodiment above, in this embodiment, when the data read operation instruction is received, before determining whether the slave database is in the synchronization delay state, it also includes: periodically calculating the synchronization delay of the slave database; The synchronization delay of the slave database within the first preset number of cycles, calculate the synchronization delay of the slave database at the preset time in the future; if the synchronization delay of the slave database at the preset time is greater than or equal to the preset delay at the preset time Threshold, the slave is set to the sync-delayed state. Such as figure 2 As shown, before determining whether the slave database is in a synchronization delay state, the method further includes the following steps:
[0059] Step S201...
Embodiment 3
[0097] image 3 It is a flow chart of the database access method with read-write separation provided in Embodiment 3 of the present invention. On the basis of the second embodiment above, in this embodiment, after periodically calculating the synchronization delay of the slave database, it also includes: periodically calculating the increment of the data change message generated by the producer service and the data change message generated by the consumer service The processing volume of change messages; calculate the average increment and average processing volume of data change messages in each period according to the increment of data change messages generated by the producer service of the first preset number of cycles; calculate the future preset time The number of cycles between the interval from the latest cycle; the number of cycles according to the interval between the preset time and the latest cycle, the average increment and average processing volume of data change...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More - R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com



