Intercepting database queries and forwarding them to an in-memory data grid
The method intercepts and routes database queries to an in-memory data grid based on predefined criteria, enabling efficient integration without modifying the application, thus optimizing data grid utilization and performance.
Patent Information
- Application Number
- DE112012001805
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2011-06-06
- Filing Date
- 2012-06-06
- Publication Date
- 2024-08-29
- Estimated Expiration
- 2032-06-06
AI Technical Summary
Existing applications must be modified to interface with in-memory data grids, which is cumbersome and inefficient, and existing solutions require changes to the application code.
A method to intercept database queries and selectively route them to an in-memory data grid without modifying the application code, using a data grid interception logic that compares queries with a routing list and determines forwarding based on grid utilization thresholds.
Seamless integration of applications with in-memory data grids is achieved, enhancing performance without altering the application code, and optimizing data grid utilization.
Smart Images

Figure DE112012001805B4_0000 
Figure DE112012001805B4_0001 
Figure DE112012001805B4_0002
Abstract
Description
BACKGROUND OF THE INVENTIONField of the InventionThe present invention relates to grid computing and, more particularly, to processing database queries within an in-memory data grid.Description of the Underlying TechniqueGrid computing refers to the concurrent use of the computing resources of multiple different computers in a computer communications network for a single computing problem. Grid computing provides a significant advantage when solving scientific or technical problems that require a large number of computer data processing cycles or access to large amounts of data. In general, grid computing requires the use of computer program logic capable of partitioning a data processing problem into a management portion and an independently calculable portion of the problem to assign these portions to as many computers as needed and available. In many cases, the term grid computing is understood to mean a distributed data processing in clusters on a large scale and a form of parallel data processing distributed over a network.The document "The state of the art in distributed query processing" by Donald Kossmann, published in ACM Computing Surveys (CSUR), 2000, 32 Jg., No. 4, pp 422-469 describes query processing for distributed database and information systems.US 2011 / 0 010 379 A1 describes a database system comprising: a first database with back-end functionality for data storage and execution of database queries, a database front-end and a interception unit. The database front end is configured to process user queries directed to a back end of a second database and does not have the capabilities for direct access to the first database. The interception unit is networked to the first database via a data network and is configured to monitor the front end processed user queries to identify queries relating to data stored in the first database and to redirect the identified queries to the first database for execution. In this way, the functionality of the database front end is provided for the data stored in the first database.A data grid (data grid), unlike a data processing grid, includes a system that consists of multiple cooperating servers to process data and associated operations in a distributed environment. An "intra-memory" data grid is again a data grid that stores the data internally in memory to achieve very high performance, and uses redundancies by keeping copies of this data synchronized across multiple servers to ensure system resiliency and availability of the data in the event of a server failure. An in-memory data grid results in short response times for data access by keeping data in memory and in the form of an application object and sharing that data with multiple servers. In other words, applications can access desired data without network transmission and without any data transformation steps such as relational object mapping.When an intra-memory data grid is introduced, users see as a great hurdle that applications must be modified to "address" the data grid. For this purpose, these applications are normally coded in such a way that they access a database by querying via a known interface, and changing the applications for a grid instead of a database can prove to be costly. An alternative approach involves creating stored procedures of a data grid instead of a database. However, the respective application must also be modified in the case of the approach with stored procedures.SUMMARY OF THE INVENTIONEmbodiments of the present invention overcome shortcomings in the prior art relating to the integration of data grids and provide a novel and unique method, system and computer program product for seamless integration of an application with an in-memory data grid.According to one embodiment of the invention, a method is provided for intercepting database queries from a computer program for forwarding to an in-memory data grid. The method includes retrieving database queries from a database driver for a database management system from a requesting computer program and comparing at least a portion of each of the database queries to a list of database queries. Then, based on the comparison, the database queries are selectively forwarded to a data grid, such as an intra-memory data grid, rather than to the database manager.According to one aspect of the embodiment, only the database queries included in the list of database queries are forwarded to the data grid. Alternatively, according to another aspect of the embodiment, only those database queries included in the list of database queries are forwarded to the database management system. In yet another aspect of the embodiment, only those database queries included in the list of database queries are forwarded to the data grid only if it is determined that the data grid has not been simultaneously exhausted beyond a threshold. Optionally, the database queries are provided to the data grid for processing by a correspondingly defined data grid handler in the list of database queries.Other aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The aspects of the invention are realized and attained by means of the elements and combinations particularly pointed out in the appended claims. It is to be understood that both the foregoing general description and the following detailed description are illustrative and not restrictive of the invention in the form claimed.SUMMARY OF THE VARIOUS DRAWING VIEWSThe accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention. The embodiments illustrated herein are currently considered preferred embodiments, however, it is to be understood that the invention is not limited in detail to the arrangements and equipment shown, wherein: FIG. 1 is a pictorial illustration of a process for intercepting database queries from a computer program for forwarding to an in-memory data grid; FIG. 2 is a schematic illustration of a data processing system configured to intercept database queries from a computer program for forwarding to an in-memory data grid; and FIG. 3 is a flow chart illustrating a process for intercepting database queries from a computer program for forwarding to an in-memory data grid.DETAILED DESCRIPTION OF THE INVENTIONEmbodiments of the invention provide for intercepting database queries from a computer program for forwarding to an in-memory data grid. According to an embodiment of the invention, in a database driver for a database which is connected to the computer program for the purpose of data exchange, a database query can be received from a computer program. It can be checked whether the database query should be forwarded not to the database but to the data grid inside the memory. If so, the database query may be forwarded to an in-memory data grid instead of the database. Otherwise, the database query can be forwarded not to the in-memory data grid, but to the database. In this way, the computer program can be integrated with the data grid within the memory without the computer program itself having to be modified.For further illustration, Figure 1 pictorially illustrates a process for intercepting database queries from a computer program for forwarding them to an in-memory data grid. FIG. 1 shows that data grid interception logic 140 may be connected to both a database management system 130 and a data grid 160 of different data storage resources 170. Data grid interception logic 140 may receive database queries 120 from one or more computer programs 110 in a host computer environment 100. The data grid interception logic 140 may compare one or more portions of each of the queries 120 with a query forwarding list 150 to check whether the queries 120 are to be forwarded to the database management system 130 or to the data grid 160. In the latter case, a retrieval routine for the data grid 160 may be determined from the query forwarding list.The process described in connection with FIG. 1 may be employed in a data processing system. For further illustration, FIG. 2 schematically illustrates a data processing system configured to intercept database queries from a computer program and to pass to an in-memory data grid. The system may include a host computer 210 connected to a database management system 230 via a computer network 240. Database management system 230 may provide functionality for accessing data stored in database 250.The host computer 210 may include at least one processor and memory and may support execution of one or more computer programs (only a single computer program being shown for illustrative purposes). A database driver 270 may be logically connected to the computer program 220 either as part of the computer program 220 executing in the memory of the host computer 210 or by remote access over a link for interprocess communication. Database driver 270 may provide an interface to computer program 220 to perform query operations for data in database 250 in database management system 230.Note that a data grid forwarding module 300 may be connected to the database driver 270. The data forwarding module 300 may include program code which, when executed by a processor of a computer, serves to compare at least a portion of a database query received in the database driver 270 with a list of database queries in a query forwarding table 280. In particular, the list of database queries in the query forwarding table 280 may represent a list of queries that were previously determined to be forwarded to a data grid 260 rather than to a database management system 230, for example, to an in-memory data grid rather than to the database management system 230. The data forwarding module 300 may include further program code that, when executed by a processor of a computer, is operable to forward a database query received in the database driver 270 to the data grid 260 rather than to the database management system 230 if the received database query is determined to be listed in the query forwarding table 280.To illustrate in more detail the operation of the data grid forwarding module 300, FIG. 3 shows a flow chart illustrating a process for intercepting database queries from a computer program and forwarding to an in-memory data grid. Initially, at block 310, a database query may be retrieved from the database driver. At block 320, at least a portion of the database query may be compared to a list of queries in the forwarding table. At decision block 330, it may be determined whether to pass the database query to the database management system or to the data grid for completion. In the former case, the database query may be forwarded to the database management system in block 340.In the latter case, in block 350, the operating state of the data grid, i.e. the degree of utilization of the data grid at the same time, can be determined. If it is determined at decision block 360 that the data grid was exhausted beyond a threshold at this time, the database query may be forwarded to the database management system at block 340, although it was determined a priori to forward the database query to the data grid. However, if it is determined that the data grid has not been used beyond a threshold at this time, a data grid handler for the database query may be selected from the forwarding table at block 370. Next, at block 380, the database query may be forwarded to the selected data grid handler to be processed by the data grid rather than the database management system.It will be appreciated by those skilled in the art that aspects of the present invention may be implemented as a system, method, or computer program product. Accordingly, aspects of the present invention may take the form of a complete hardware embodiment, a complete software embodiment (including firmware, resident software, microcode, etc.), or an embodiment that integrates software and hardware aspects and may all be referred to herein as a "circuit", "module", or "system". Moreover, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable media having computer readable program code stored thereon.Any combination of one or more computer readable media may be used. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination thereof. More specific examples (a non-exhaustive enumeration) of the computer readable medium may include: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage unit, a magnetic storage unit, or any suitable combination thereof. In connection with this document, a computer readable storage medium may be any tangible medium that can contain or store a program for use by or in connection with a system, apparatus, or device for executing applications.As a computer readable signal medium, a propagated data signal having computer readable program code embodied therein may be considered, for example, in baseband or as part of a carrier wave. Such a propagated signal may take a variety of forms, including, but not limited to, electromagnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can transmit, forward, or transport a program for use by or in connection with a system, apparatus, or device for executing applications.Program code embodied on a computer readable medium may be transmitted using any suitable medium, including, but not limited to, wireless, wireline, optical fiber, radio frequency, and the like, or any suitable combination thereof. Computer program code for carrying out operations for aspects of the present invention may be implemented in any combination of one or more programming languages, including an object oriented programming language and conventional procedural programming languages. The program code may execute entirely on a user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer by any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made (for example, through the Internet using an Internet Service Provider) to an external computer.Aspects of the present invention have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. In this regard, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible embodiments of systems, methods, and computer program products according to various embodiments of the present invention. For example, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, including one or more executable instructions for implementing the specified logic functions. It should also be noted that in some alternative embodiments, the functions indicated in the block may occur in a different order from the figures. For example, depending on the intended functionality, two blocks shown in succession may in fact be executed substantially simultaneously, or the blocks may sometimes be executed in the reverse order. It is further noted that each block in the block diagrams and / or flowchart, and combinations of blocks in the block diagrams and / or flowchart, may be implemented by special purpose hardware systems that perform the specified functions or acts, or combinations of hardware and computer instructions.It will be appreciated that each block of the flowchart and / or block diagrams, and combinations of blocks in the flowchart and / or block diagrams, may be implemented by instructions of a computer program. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner such that the instructions stored in the computer readable medium produce a product including instructions that implement the function / action specified in the flowchart and / or block diagram block or blocks. The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a sequence of operations to be performed on the computer, other programmable apparatus, or other devices to produce a computer-assisted process such that the instructions executed on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.Finally, the terms used herein are used only to describe specific embodiments and should not be understood as limiting the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the text clearly indicates otherwise. Further, it is understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.The corresponding structures, materials, acts, and equivalents of all means or steps plus functional elements in the following claims are intended to include all structures, materials, or acts for performing the function in combination with other expressly claimed elements. The description of the present invention has been presented for purposes of illustration and description, but does not claim completeness or limitation of the invention in the form disclosed. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others skilled in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.Having thus described the invention of the present application in detail and with reference to embodiments thereof, it will be apparent that changes and variations are possible without departing from the scope of the invention, which is defined in the appended claims as follows:
Claims
A method for intercepting database queries (120) from a computer program (110) for forwarding to an in-memory data grid (160), the method comprising: enabling a database driver (270) for a database management system (130) to forward database queries (120) from a database to an in-memory data grid (160); retrieving database queries (120) from a database driver (270) for a database management system (130) from a requesting computer program (110); comparing at least a portion of the database queries (120) to a list of database queries determined a priori for forwarding to the in-memory data grid (160); selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager, the comparison being critical to whether the database queries are forwarded to the data grid or to the database manager and on the condition that one of the retrieved database queries is forwarded to the in-memory data grid instead of the database manager; and determining a retrieval routine from a query forwarding list (150) from the list of database queries.The method of claim 1, wherein the database driver (270) is integrated as part of the computer program (110).The method of claim 1, wherein selectively forwarding the database queries (120) to a data grid (160) based on the comparison comprises forwarding only those database queries to the data grid that are included in the list of database queries rather than to the database manager.The method of claim 1, wherein selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager comprises forwarding only those database queries to the database manager system that are included in the list of database queries.The method of claim 1, wherein selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager comprises forwarding only those database queries (120) to the data grid (160) that are included in the list of database queries and only if it is determined that the data grid (160) has not been simultaneously exhausted beyond a threshold.The method of claim 1, wherein selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager comprises forwarding to the data grid (160) using a correspondingly defined data grid handler in the list of database queries only those database queries included in the list of database queries.A data processing system comprising: a database management system (130) executed internally by at least one processor of a computer and providing functionality for accessing data in at least one connected database (250); a database driver (270) providing an interface (220) for querying the database management system (130); an intra-memory data grid (160) connected to the database driver (270) for communication over a computer communication network; and a data grid forwarding module (300) connected to the database driver (270), the module comprising program code, execution of which realizes a method for retrieving database queries (120) from the database driver (270) from a requesting computer program (110) according to any one of the preceding claims, for comparing at least a portion of each of the database queries (120) with a list of the database queries and selectively forwarding the database queries (120) to the data grid (160) instead of to the database manager based on the comparison.The system of claim 7, wherein the database driver (270) is integrated as part of the computer program (110).The system of claim 7, wherein the data grid forwarding module (300) forwards only those database queries (120) to the data grid (160) that are included in the list of database queries.The system of claim 7, wherein the data grid module (300) forwards only those database queries (120) to the database management system (130) that are included in the list of database queries.The system of claim 7, wherein the data grid module (300) forwards only those database queries (120) included in the list of database queries to the data grid (160) only if it is determined that the data grid (160) has not been simultaneously exhausted beyond a threshold.The system of claim 7, wherein the data grid module (300) forwards only those database queries included in the list of database queries to the data grid (160) using a correspondingly defined data grid handler in the list of database queries.A computer program product for intercepting database queries from a computer program (110) for forwarding to an in-memory data grid (160), the computer program product comprising: a computer readable storage medium having stored thereon computer readable program code, execution of which realizes a method for retrieving database queries from the database driver (270) from a requesting computer program (110) according to any preceding claim, the computer readable program code comprising: computer readable program code for retrieving database queries (120) from a database driver (270) for a database management system (130) from a requesting computer program (110); computer readable program code for comparing at least a portion of each of the database queries (120) with a list of the database queries; and computer readable program code for selectively forwarding the database queries (120) to a data grid (160) instead of to the database manager based on the comparison.The computer program product of claim 13, wherein the database driver (270) is incorporated as a part of the computer program (110).The computer program product of claim 13, wherein the computer readable program code for selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager comprises computer readable program code for forwarding only those database queries (120) included in the list of database queries to the data grid (160).The computer program product of claim 13, wherein the computer readable program code for selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager comprises the computer readable program code for forwarding only those database queries (120) included in the list of database queries to the database manager.The computer program product of claim 13, wherein the computer readable program code for selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager comprises the computer readable program code for forwarding only those database queries (120) included in the list of database queries and only if it is determined that the data grid (160) has not been simultaneously exhausted beyond a threshold.The computer program product of claim 13, wherein the computer readable program code for selectively forwarding the database queries (120) based on the comparison to a data grid (160) rather than to the database manager comprises the computer readable program code for forwarding only those database queries (120) included in the list of database queries to the data grid (160) using a correspondingly defined data grid handler in the list of database queries.
Citation Information
Patent Citations
Database system with query interception and redirection
US20110010379A1
