Supercharge Your Innovation With Domain-Expert AI Agents!

Database cache implementation method and system

An implementation method and database technology, applied in the field of database cache implementation methods and systems, can solve problems such as increasing software development costs, increasing system risks, dirty data, etc., to achieve intelligent data update, realize intelligent data caching, and solve dirty data. Effect

Active Publication Date: 2017-08-11
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF7 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Sometimes the modification of the interface even leads to cascading updates of external related systems, which further increases the development cost of the software
[0008] c) Increase the cost of debugging, and the problem is difficult to find
[0009] A large number of modifications to the old code greatly increase the risk of the system, and also increase the investment of QA personnel
In addition, since the database data system and the cache system are not synchronized, it is difficult to locate the problem when dirty data occurs
Especially in large applications, a piece of data sometimes has more than one update entry, which leads to a very high probability of dirty data

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
  • Database cache implementation method and system
  • Database cache implementation method and system
  • Database cache implementation method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0146] Embodiment 1 of the present invention is: a method for implementing database cache, which can be applied to all front-end and back-end application programs using database technology. Such as figure 2 shown, including the following steps:

[0147] S101: Create a listener at the transport layer; further, create a listener in a database operation interface or a database connection tool. details as follows:

[0148] a) The application program will have a framework layer, and the business logic will be developed on the basis of this framework layer. The framework layer will provide some common basic functions, including the encapsulation of all operations on the database; just make a hook in these interfaces , all database operations can be captured. The advantage of this method is that it is simple to implement, and because the framework layer has already differentiated the database operation, it saves the parsing operation of the SQL statement in the later stage.

[0...

Embodiment 2

[0163] This embodiment is a further extension of steps S203 and S204 in the first embodiment.

[0164] Such as Figure 4 As shown, "generate the cache corresponding to the SQL statement", that is, the step S203 includes the following steps:

[0165] S2031: Create the first record whose key is the table name, and assign a value; that is, create the first record whose key is "table name".

[0166] S2032: Create a second record whose key is the table name and the condition, and assign a value; that is, create a second record whose key is "table name+condition".

[0167] S2033: Create a third record whose key is the table name and Batch, and assign a value; that is, create a third record whose key is "table name+Batch".

[0168] S2034: Execute the SQL statement in the database server to obtain a corresponding result;

[0169] S2035: Using the SQL statement as a key, using the value of the first record, the value of the second record, the value of the third record, and the corre...

Embodiment 3

[0185] This embodiment is a further extension of step S103 and step S206 in the first embodiment.

[0186] Step S103 also includes, if it is an update operation (UPDATE), execute step S301, and if it is an insert operation (DELETE), execute step S401.

[0187] Such as Figure 6 As shown, if the operation type corresponding to the SQL statement is an update operation, perform the following steps:

[0188] S301: Determine whether the condition corresponding to the SQL statement involves only one piece of data, if not, execute step S302, and if yes, execute step S304; the judgment basis is the same as step S2044.

[0189] S302: Determine whether there is a first record whose key is the table name, if yes, execute step S303, if not, execute step S308.

[0190] S303: Update the value of the first record; execute step S308.

[0191] S304: Determine whether there is a second record whose key is the table name and the condition, if yes, perform step S305, and if not, perform step S...

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 present invention discloses a database cache implementation method and system. The method comprises: creating a listener at a transport layer; the listener capturing a SQL statement, and obtaining an operation type, a table name and a condition corresponding to the SQL statement through analysis; if the operation type corresponding to the SQL statement is a query operation, determining whether a cache corresponding the SQL statement exists; if no, according to the table name and the condition corresponding to the SQL statement, generating the cache corresponding to the SQL statement and returning a database query result; and if yes, according to the table and the condition corresponding to the SQL statement, updating the cache corresponding to the SQL statement and returning the database query result, or returning a cache result according to the cache corresponding to the SQL statement. According to the method provided by the present invention, a behavior of a user is pre-determined by analyzing the SQL statement, so that not only performance of a server is effectively improved, but also zero development and maintenance cost of products is realized.

Description

technical field [0001] The invention relates to the technical field of database caching, in particular to a database caching implementation method and system thereof. Background technique [0002] In the initial stage of a project, in order to bring the product to the market as soon as possible, the team cannot devote too much energy to performance optimization. However, when the product was recognized by the market, it was accompanied by an explosive growth in the number of users, which brought enormous pressure to the back-end database. At this time, most teams will use hardware expansion solutions to solve server performance problems. However, when hardware expansion reaches a certain bottleneck, the development team needs to design a caching system based on business logic and software architecture design to solve the pressure on the database. . [0003] The caching system designed in this case can usually only be applied to a single software product, and its disadvanta...

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
IPC IPC(8): G06F17/30
CPCG06F16/235G06F16/2433G06F16/24539G06F16/24552
Inventor 刘德建陈铭陈红和钟良德郭玉湖
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More