Method and apparatus for reading data from database

A technology for reading data and data reading, applied in the database field, can solve problems such as tediousness, system complexity, and affecting database performance, and achieve the effects of reducing complexity, reducing pressure, and realizing real-time performance

Active Publication Date: 2012-10-17
JUHAOKAN TECH CO LTD
View PDF7 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This method has the following disadvantages: Each cache node needs to regularly poll the database when checking whether the data in the incremental table or the source table has changed. When the system is relatively large and there are many cache nodes, frequent and large polling of the database will It will seriously affect the performance of the database and put more pressure on the database, and the regular polling of each cache node must have a time interval. When the data of the incremental table or the source table changes, the real-time performance of updating the cache is not particularly high
However, this method needs to write corresponding cache update code for all functional modules that handle cache data updates
And because the changed data is transmitted through the application program, when multi-node caching is required in some large-scale application systems, because the data required by each caching node is different, it is necessary to configure each caching node accordingly, which will make the entire system It is very complex and cumbersome, and the development difficulty, development volume and maintenance volume will greatly increase

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
  • Method and apparatus for reading data from database
  • Method and apparatus for reading data from database
  • Method and apparatus for reading data from database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] Embodiments of the present invention provide a method for reading data from a database, such as figure 1 As shown, the method includes:

[0031] 101. According to the data content to be cached by the cache node, establish a data read control table and create a message queue for the data content to be cached.

[0032] Wherein, the data reading control table includes: a cache node information table and a cache node data table. The cache node information table includes a cache node ID and a cache node identifier, and the cache node data table includes a data table identifier, a home cache node identifier, and an actual read object identifier.

[0033] 102. When the application program updates the data in the database, the trigger corresponding to the data table of the updated data writes the updated data information of the data table and the identifier of the cache node to be cached in the data table into the data table in the corresponding message queue.

[0034] 103. ...

Embodiment 2

[0037] Embodiments of the present invention provide a method for reading data from a database, such as figure 2 As shown, the method includes:

[0038]201. According to the data content that the cache node needs to cache, establish a data reading control table and create a message queue for the data content that needs to be cached, the data reading control table includes a cache node information table and a cache node data table, the The cache node information table includes a cache node ID and a cache node identifier, and the cache node data table includes a data table identifier, a home cache node identifier, and an actual read object identifier.

[0039] Wherein, according to the data content that the cache node needs to cache, creating a message queue for the data content that needs to be cached can be implemented by the following method, the method includes: according to the data content that the cache node needs to cache, create a message queue for different types of C...

Embodiment 3

[0063] An embodiment of the present invention provides a device for reading data from a database, such as Figure 5 As shown, the device includes: a creation unit 31 , a creation unit 32 , a writing unit 33 , and a reading unit 34 .

[0064] The establishment unit 31 is configured to, according to the data content to be cached by the caching node, create a data read control table for the data content to be cached.

[0065] The creation unit 32 is configured to create a message queue for the data content to be cached according to the data content to be cached by the cache node. Specifically, the creating unit 32 is configured to create different message queues for different types of data content to be cached according to the data content to be cached by the cache node.

[0066] The writing unit 33 is configured to write the update data information of the data table and the cache node identifier for caching the data table into the trigger corresponding to the data table of the ...

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 embodiments of the present invention disclose a method and an apparatus for reading data from a database, which relate to databases, achieve the real-time update of caches, and reduce the complexity of overall application system development. The method of the present invention includes: according to the data contents which need to be cached by a cache node, a data read control table is established and a message queue is created for the data contents which need to be cached; when an application program updates the data in a database, a trigger corresponding to the data table of the update data writes the update data information of the data table and the identifier of the cache node into which the data table needs to be cached into the message queue corresponding to the data table; ; the cache node reads the message queue corresponding to the cache node according to the cache node identifier, and updates the data in the cache node according to the update data information. The embodiments of the present invention are mainly used in the process that the cache system reads data from a database and updates the cache.

Description

technical field [0001] The invention relates to the field of databases, in particular to a method and device for reading data from a database. Background technique [0002] In modern computer technology, the application of database is very extensive. It is a warehouse for organizing, storing and managing data. As the core of the entire application system, the importance of the database is self-evident. In most applications, database read operations are more intensive than write operations, and the query conditions are relatively complex. Most of the performance of the database is consumed in queries, especially in large-scale applications with high users and high concurrency. The cost of direct database read Very high, then the database will become the bottleneck of the entire application. A cache is a part of memory that is used to cache data. When the application needs the data, it can be fetched directly from the cache without accessing the database. Therefore, cachin...

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
CPCG06F17/3048G06F16/24552
Inventor 王震
Owner JUHAOKAN TECH 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