Reading and writing method and system of master slave separation database

A master database, read-write method technology, applied in the database field, can solve the problems of limited capacity, complex design of cache technology solutions, and high implementation costs

Active Publication Date: 2012-04-04
BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF3 Cites 33 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the use of caching technology needs to consider the consistency between the cached copy data and the data in the database, as well as the cache invalidation and cache object replacement mechanism, and the cache has a limited capacity compared to the massive data in the database; in addition, if distributed Caching technology also considers the synchronization between caches
Therefore, the solution design of caching technology is complex and the implementation cost is high. Especially for the transformation of the legacy system, it is generally necessary to modify the existing program. The design of the above solution is more complicated and the implementation cost is higher.
[0006] Therefore, a technical problem that needs to be solved urgently by those skilled in the art is: how to solve the master-slave synchronization simply and reliably when the master-slave database system reads and writes separately, when the user request includes the first write operation and then the read operation. The delay problem

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Reading and writing method and system of master slave separation database
  • Reading and writing method and system of master slave separation database
  • Reading and writing method and system of master slave separation database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0048] In order to make the above objects, features and advantages of the present application more obvious and comprehensible, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0049] This application provides a master-slave separation database reading and writing method and system, by analyzing and processing the SQL statement sequence in the business operation corresponding to the user request one by one at the application layer, if the current SQL statement involves modification operations, then the required Record the table name of the operation; judge whether the table name record includes the table name that the current SQl statement needs to operate, and if so, switch the current SQL statement to the main database for execution. By recording the record of the table that has been modified in the SQL statement sequence corresponding to the business operation requested by th...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a reading and writing method and system of master slave separation database, referring to the field of database, wherein the method includes the steps of: confirming a corresponding business operation according to a user requirement; analyzing and processing a table of each SQL sentence to be operated in the business operation one by one; judging whether the table should be modified, if yes, recording the table name; judging whether the recorded table name includes the table name including the table of each SQL sentence to be operated, if yes, switching the current SQL sentence to the main database to execute. The table modified in the SQL sentence sequence of the business operation corresponding to the user requirement is recorded, and all the subsequent operations on the table are switched to the main database, so that the method does not need multiple complex designs and can simply and reliably avoid the synchronous time delay problem of the main slave database with a low cost.

Description

technical field [0001] The present application relates to the field of databases, in particular to a method and system for reading and writing a master-slave separated database. Background technique [0002] In large-scale enterprise applications, due to the large amount of data and large concurrent access, the database can easily become a performance bottleneck. One of the ways to solve this problem is the separation of master-slave reading and writing, that is, using two or more databases, one of which is the master database, the master database can read and write, and the other is the slave database, which is read-only, through the database management system The provided synchronization mechanism synchronizes data with the main database. In this way, read-only operations can be transferred to the slave database, thereby reducing the pressure on the master database. However, the synchronization from the master database to the slave database cannot be completely real-time...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 张顺王磊李剑
Owner BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products