Abstract:
Embodiments of the present invention provide a method, system and computer program product for the seamless integration of an application with an in memory data grid. In an embodiment of the invention, a method for intercepting database queries from a computer program for delegation to an in memory data grid is provided. 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 listing of database queries. Thereafter, the database queries are selectively routed to a data grid, such as an in memory data grid, in lieu of the database management based upon the comparison.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to grid computing and more particularly to database query processing within an in memory data grid. 
         [0003]    2. Description of the Related Art 
         [0004]    Grid computing refers to the use of the computing resources of multiple different computers in a computer communications network to a single computational problem concurrently. Grid computing provides substantial advantage when addressing scientific or technical problems that require a great number of computer processing cycles or access to large amounts of data. Generally, grid computing requires the use of computer program logic enabled to divide a computational problem into management and independently computable problem subsets, and to assign those subsets to as many computing resources in as many computers as required and available. To many, grid computing is thought of as distributed and large-scale cluster computing and as a form of network-distributed parallel processing. 
         [0005]    A data grid, in contrast, to a computational grid includes a system composed of multiple servers that work together to manage information and related operations in a distributed environment. An “in memory” data grid, in turn, is a data grid that stores the information in memory in order to achieve very high performance, and uses redundancy—by keeping copies of that information synchronized across multiple servers—in order to ensure the resiliency of the system and the availability of the data in the event of server failure. An in memory data grid achieves low response times for data access by maintaining stored information in memory and in an application object form, and by sharing that information across multiple servers. In other words, applications may be able to access required information without any network communication and without any data transformation step such as an object relational mapping. 
         [0006]    When considering adoption of an in memory data grid, adopters consider as a major obstacle the need to modify applications to ‘talk’ to the data grid. In this regard, these applications are typically coded to interface with a database by way of querying according to a known interface, and modifying applications to respect a grid as opposed to a database can be an expensive proposition. An alternative approach includes the creation of stored procedures to interrogate a data grid as opposed to a database. Even still, the stored procedure approach still requires the modification of the underlying application. 
       BRIEF SUMMARY OF THE INVENTION 
       [0007]    Embodiments of the present invention address deficiencies of the art in respect to data grid integration and provide a novel and non-obvious method, system and computer program product for the seamless integration of an application with an in memory data grid. In an embodiment of the invention, a method for intercepting database queries from a computer program for delegation to an in memory data grid is provided. 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 listing of database queries. Thereafter, the database queries are selectively routed to a data grid, such as an in memory data grid, in lieu of the database management based upon the comparison. 
         [0008]    In an aspect of the embodiment, only those of the database queries that are included in the listing of database queries are routed to the data grid. Alternatively, in another aspect of the embodiment, only those of the database queries that are included in the listing of database queries are routed to the database management system. In yet another aspect of the embodiment, only those of the database queries that are included in the listing of database queries are routed to the data grid and only when the data grid is determined not have been contemporaneously utilized above a threshold level. Optionally, when the database queries are routed to the data grid, the database queries are provided to the data grid for handling by a correspondingly specified data grid handler in the listing of the database queries. 
         [0009]    Additional 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 will be 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 exemplary and explanatory only and are not restrictive of the invention, as claimed. 
     
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS 
         [0010]    The accompanying drawings, which are incorporated in and constitute 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 presently preferred, it being understood, however, that the invention is not limited to the precise arrangements and instrumentalities shown, wherein: 
           [0011]      FIG. 1  is a pictorial illustration of a process for intercepting database queries from a computer program for delegation to an in memory data grid; 
           [0012]      FIG. 2  is a schematic illustration of a data processing system configured for intercepting database queries from a computer program for delegation to an in memory data grid; and, 
           [0013]      FIG. 3  is a flow chart illustrating a process for intercepting database queries from a computer program for delegation to an in memory data grid. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0014]    Embodiments of the invention provide for the interception of database queries from a computer program for delegation to an in memory data grid. In accordance with an embodiment of the invention, a database query from a computer program can be received in a database driver for a database communicatively coupled to the computer program. A determination can be made whether or not to route the database query to an in memory data grid in lieu of the database. If so, the database query can be routed to the in memory data grid in lieu of the database. Otherwise, the database query can be routed to the database and not the in memory data grid. In this way, the computer program can be integrated with the in memory data grid without requiring modification of the computer program itself. 
         [0015]    In further illustration,  FIG. 1  pictorially shows a process for intercepting database queries from a computer program for delegation to an in memory data grid. As shown in  FIG. 1 , data grid interception logic  140  can be coupled both to a database management system  130  and also a data grid  160  of different data storage resources  170 . The data grid interception logic  140  can receive database queries  120  from one or more computer programs  110  in a host computing environment  100 . The data grid interception logic  140  can compare one or more portions of each of the queries  120  to a query routing list  150  to determine whether or not each of the queries  120  is to be routed to the database management system  130 , or the data grid  160 . In the latter instance, a fetch routine for the data grid  160  can be determined from the query routing list. 
         [0016]    The process described in connection with  FIG. 1  can be implemented in a data processing system. In yet further illustration,  FIG. 2  schematically shows a data processing system configured for intercepting database queries from a computer program for delegation to an in memory data grid. The system can include a host computer  210  communicatively coupled to a database management system  230  over computer communications network  240 . The database management system  230  can provide functionality operable to access data stored in a database  250 . 
         [0017]    The host computer  210  can include at least one processor and memory and can support the execution of one or more computer programs  220  (only a single computer program shown for the purpose of illustrative simplicity). A database driver  270  can be logically coupled to the computer program  220  either as part of the computer program  220  executing in the memory of the host computer  210 , or remotely over an interprocess communications linkage. The database driver  270  can provide an interface to the computer program  220  for performing query operations on data in the database  250  in the database management system  230 . 
         [0018]    Of note, data grid routing module  300  can be coupled to the database driver  270 . The data routing module  300  can include program code that when executed by a processor of a computer, is operable to compare at least a portion of a database query received in the database driver  270  to a list of database queries in query routing table  280 . More particularly, the list of database queries in query routing table  280  can represent a listing of queries that have been a priori determined for routing onto a data grid  260 , for example an in memory data grid, instead of to the database management system  230 . The data routing module  300  can include additional program code that when executed by a processor of a computer, is operable to route a received database query received in the database driver  270  to the data grid  260  in lieu of the database management system  230  when the received database query is determined to have been listed in the query routine table  280 . 
         [0019]    In even yet further illustration of the operation of the data grid routing module  300 ,  FIG. 3  is a flow chart illustrating a process for intercepting database queries from a computer program for delegation to an in memory data grid. Beginning in block  310 , a database query can be retrieved from the database driver. In block  320 , at least one portion of the database query can be compared to a listing of queries in the routing table. In decision block  330 , it can be determined whether to route the database query to the database management system for satisfaction, or to the data grid for satisfaction. In the former instance, in block  340  the database query can be routed to the database management system. 
         [0020]    In the latter instance, in block  350  the operational status of the data grid can be determined—namely the degree to which the data grid has been utilized contemporaneously. In decision block  360 , if the data grid is determined to have been contemporaneously utilized beyond a threshold level, in block  340  the database query can be routed to the database management system though the database query had been determined a prior to be routed to the data grid. However, if the data grid is determined to have not been contemporaneously utilized beyond a threshold level, in block  370  a data grid handler can be selected for the database query from the routing table. Subsequently, in block  380  the database query can be routed to the selected data grid handler for satisfaction by the data grid in lieu of the database management system. 
         [0021]    As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon. 
         [0022]    Any combination of one or more computer readable medium(s) may be utilized. 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 not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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 device, a magnetic storage device, or any suitable combination of the foregoing. In the context of 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 an instruction execution system, apparatus, or device. 
         [0023]    A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, 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 communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. 
         [0024]    Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, radiofrequency, and the like, or any suitable combination of the foregoing. Computer program code for carrying out operations for aspects of the present invention may be written 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 the user&#39;s computer, partly on the user&#39;s computer, as a stand-alone software package, partly on the user&#39;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&#39;s computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). 
         [0025]    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 implementations of systems, methods and computer program products according to various embodiments of the present invention. For instance, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. 
         [0026]    It also will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. 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, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. 
         [0027]    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 an article of manufacture including instructions which implement the function/act 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 series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute 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. 
         [0028]    Finally, the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further 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. 
         [0029]    The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill 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 of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated. 
         [0030]    Having thus described the invention of the present application in detail and by reference to embodiments thereof, it will be apparent that modifications and variations are possible without departing from the scope of the invention defined in the appended claims as follows: