Method and System for Reducing Deadlock and Query Management in Database
LSTM-based query management in database systems reroutes queries to available nodes or edge resources, preventing deadlocks and ensuring continuous operation by optimizing query processing and reducing latency.
Patent Information
- Application Number
- US19/215454
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2026-11-26
AI Technical Summary
Cloud-based and on-premises database environments face significant challenges with resource-intensive queries leading to deadlocks, blocking, and system instability, necessitating manual intervention that disrupts service level agreements and business continuity.
A method using LSTM cells to analyze time-series data for query management, rerouting blocked or deadlocked queries to available nodes within the database or edge computing resources based on capacity and availability, and generating a ranked list of nodes for optimal query execution.
Proactively prevents deadlocks by optimizing query processing, reducing latency, and ensuring continuous database operation without manual intervention, thus maintaining service level agreements.
Smart Images

Figure US20260377247A1-D00000_ABST
Abstract
Description
BACKGROUND
[0001] The present disclosure relates generally to databases, and more specifically to a method and system for reducing deadlock and query management in database.
[0002] In cloud-based and on-premises database environments, the demand for processing large and complex queries has significantly increased. Such queries often involve operations like extensive joins, full-table scans, aggregations, or processing of massive datasets. While databases are typically designed to handle concurrent workloads, the execution of resource-intensive queries can severely disrupt system stability.
[0003] A challenge arises when a heavy query monopolizes a temporary database (temp DB) or available memory. As the temporary storage reaches capacity, multiple issues may occur. Queries can become locked in deadlock situations, where two or more queries cyclically wait for each other to release resources, leading to indefinite blocking. Even lightweight or otherwise non-disruptive queries become stalled or blocked due to unavailability of critical resources. In some cases, not only the problematic heavy query fails or hangs, but it also causes failure or substantial degradation of all other concurrent queries.
[0004] Such scenarios often require manual intervention by a database administrator (DBA) to diagnose the issue, identify the blocking session ID (SID), and forcibly terminate the problematic query. This manual intervention is disruptive, time-consuming, and often results in breach of service level agreements (SLAs), loss of business continuity, and failure of downstream applications dependent on database operations.
[0005] These problems are particularly prevalent during predictable peak times when heavy jobs are scheduled to run simultaneously, thereby increasing the probability of deadlock and resource contention. If these jobs overlap during execution windows, deadlocks or large-scale blocking becomes almost inevitable. Even after resolving the blockage by terminating sessions, there is an operational need to re-run the aborted jobs, further complicating business processes and introducing inefficiencies.SUMMARY
[0006] In an illustrative embodiment, a computer-implemented method for query deployment in a database system includes receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes. The method includes analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries. Responsive to the detection of blocked or deadlocked queries, the method includes evaluating, by a second LSTM cell, nodes within a database to determine whether such nodes have capacity and availability to process the blocked or deadlocked queries. Responsive to a determination that such nodes within the database have availability and capacity, the method includes rerouting the blocked or deadlocked queries to those nodes. Responsive to a determination that there are no nodes within the database having capacity and availability to process the queries, the method includes searching, by the second LSTM cell, for available edge computing resources. Upon identifying available edge computing resources, the blocked or deadlocked queries are rerouted to the edge computing resources.
[0007] In an illustrative embodiment, the method includes dispatching, by a deployment engine, the queries to the selected edge computing resources for execution.
[0008] In an illustrative embodiment, the method includes generating, by the second LSTM cell, a ranked list of database nodes based on availability and capacity.
[0009] In an illustrative embodiment, the first LSTM cell evaluates time-series metrics comprising CPU usage, memory consumption, and query duration.
[0010] In an illustrative embodiment, the ranking of database nodes includes weighting based on current free space and projected availability time.
[0011] In an illustrative embodiment, rerouting within the database is based on a comparative analysis of resource capacity and historical performance trends.
[0012] In an illustrative embodiment, the second LSTM cell identifies edge computing nodes based on proximity to a data source and available compute capacity.
[0013] In an illustrative embodiment, the edge rerouting is performed only when local database nodes are fully occupied or overloaded.
[0014] In an illustrative embodiment, a computer system includes a processor set, one or more computer-readable storage media and program instructions stored on the one or more storage media to cause the processor set to perform operations comprising: receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes; analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries; responsive to the detection of blocked or deadlocked queries, evaluating, by a second LSTM cell, nodes within a database to determine if such nodes have capacity and availability to process the blocked or deadlocked queries; if such nodes within the database have availability and capacity, rerouting the blocked or deadlocked queries to those nodes; if there are no nodes within the database having the capacity and availability to process the queries, searching, by the second LSTM cell, for available edge computing resources; and upon identifying available edge computing resources, rerouting the blocked or deadlocked queries to the edge computing resources.
[0015] In an illustrative embodiment, a computer program product includes one or more computer-readable storage media and program instructions stored on the one or more storage media to perform operations comprising: receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes; analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries; responsive to the detection of blocked or deadlocked queries, evaluating, by a second LSTM cell, nodes within a database to determine if such nodes have capacity and availability to process the blocked or deadlocked queries; if such nodes within the database have availability and capacity, rerouting the blocked or deadlocked queries to those nodes; if there are no nodes within the database having the capacity and availability to process the queries, searching, by the second LSTM cell, for available edge computing resources; and upon identifying available edge computing resources, rerouting the blocked or deadlocked queries to the edge computing resources.BRIEF DESCRIPTION OF THE DRAWINGS
[0016] FIG. 1 is a pictorial representation of a computing environment in which illustrative embodiments may be implemented;
[0017] FIG. 2 illustrates a long-short term memory (LSTM) in accordance with an illustrative embodiment;
[0018] FIG. 3 illustrates an LSTM cell in accordance with an illustrative embodiment; and
[0019] FIG. 4 depicts a process in accordance with an illustrative embodiment.DETAILED DESCRIPTION
[0020] In an illustrative embodiment, a computer-implemented method for query deployment in a database system includes receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes. The method includes analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries. Responsive to the detection of blocked or deadlocked queries, the method includes evaluating, by a second LSTM cell, nodes within a database to determine whether such nodes have capacity and availability to process the blocked or deadlocked queries. Responsive to a determination that such nodes within the database have availability and capacity, the method includes rerouting the blocked or deadlocked queries to those nodes. If there are no nodes within the database having capacity and availability to process the queries, the method includes searching, by the second LSTM cell, for available edge computing resources. Upon identifying available edge computing resources, the blocked or deadlocked queries are rerouted to the edge computing resources. As a result, the illustrative embodiment provides the technical effect of managing and optimizing database query processing using LSTM cells.
[0021] In an illustrative embodiment, the method includes dispatching, by a deployment engine, the queries to the selected edge computing resources for execution. As a result, the illustrative embodiment provides the technical effect of rerouting queries by the deployment engine to reduce deadlocks in database systems.
[0022] In an illustrative embodiment, the method includes generating, by the second LSTM cell, a ranked list of database nodes based on availability and capacity. As a result, the illustrative embodiment provides the technical effect of rerouting blocked queries to other suitable nodes.
[0023] In an illustrative embodiment, the first LSTM cell evaluates time-series metrics including CPU usage, memory consumption, and query duration. As a result, the illustrative embodiment provides the technical effect of evaluating resource consumption by queries.
[0024] In an illustrative embodiment, the ranking of database nodes includes weighting based on current free space and projected availability time. As a result, the illustrative embodiment provides the technical effect of ranking database nodes based on capacity and availability.
[0025] In an illustrative embodiment, rerouting within the database is based on a comparative analysis of resource capacity and historical performance trends. As a result, the illustrative embodiment provides the technical effect of rerouting queries to the most suitable node within the same database.
[0026] In an illustrative embodiment, the second LSTM cell identifies edge computing nodes based on proximity to the data source and available compute capacity. As a result, the illustrative embodiment provides the technical effect of reducing latency in query processing.
[0027] In an illustrative embodiment, the edge rerouting is performed only when local database nodes are fully occupied or overloaded. As a result, the illustrative embodiment provides the technical effect of utilizing nodes within the database before rerouting queries to edge computing resources.
[0028] In an illustrative embodiment, a computer system includes a processor set, one or more computer-readable storage media and program instructions stored on the one or more storage media to cause the processor set to perform operations comprising: receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes; analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries; responsive to the detection of blocked or deadlocked queries, evaluating, by a second LSTM cell, nodes within a database to determine if such nodes have capacity and availability to process the blocked or deadlocked queries; if such nodes within the database have availability and capacity, rerouting the blocked or deadlocked queries to those nodes; if there are no nodes within the database having the capacity and availability to process the queries, searching, by the second LSTM cell, for available edge computing resources; and upon identifying available edge computing resources, rerouting the blocked or deadlocked queries to the edge computing resources. As a result, the illustrative embodiment provides the technical effect of managing and optimizing database query processing using LSTM cells.
[0029] In an illustrative embodiment, the operations further comprise dispatching, by a deployment engine, the queries to the selected edge computing resources for execution. As a result, the illustrative embodiment provides the technical effect of rerouting queries by the deployment engine to reduce deadlocks in database systems.
[0030] In an illustrative embodiment, the first LSTM cell evaluates time-series metrics including CPU usage, memory consumption, and query duration. As a result, the illustrative embodiment provides the technical effect of evaluating resource consumption by queries.
[0031] In an illustrative embodiment, the ranking of database nodes includes weighting based on current free space and projected availability time. As a result, the illustrative embodiment provides the technical effect of ranking database nodes based on capacity and availability.
[0032] In an illustrative embodiment, the second LSTM cell identifies edge computing nodes based on proximity to a data source and available compute capacity. As a result, the illustrative embodiment provides the technical effect of reducing latency in query processing.
[0033] In an illustrative embodiment, the edge rerouting is performed only when local database nodes are fully occupied or overloaded. As a result, the illustrative embodiment provides the technical effect of utilizing nodes within the database before rerouting queries to edge computing resources.
[0034] In an illustrative embodiment, a computer program product includes one or more computer-readable storage media and program instructions stored on the one or more storage media to perform operations comprising: receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes; analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries; responsive to the detection of blocked or deadlocked queries, evaluating, by a second LSTM cell, nodes within a database to determine if such nodes have capacity and availability to process the blocked or deadlocked queries; if such nodes within the database have availability and capacity, rerouting the blocked or deadlocked queries to those nodes; if there are no nodes within the database having the capacity and availability to process the queries, searching, by the second LSTM cell, for available edge computing resources; and upon identifying available edge computing resources, rerouting the blocked or deadlocked queries to the edge computing resources. As a result, the illustrative embodiment provides the technical effect of managing and optimizing database query processing using LSTM cells.
[0035] In an illustrative embodiment, the operations further comprise dispatching, by a deployment engine, the queries to the selected edge computing resources for execution. As a result, the illustrative embodiment provides the technical effect of rerouting queries by the deployment engine to reduce deadlocks in database systems.
[0036] In an illustrative embodiment, the first LSTM cell evaluates time-series metrics including CPU usage, memory consumption, and query duration. As a result, the illustrative embodiment provides the technical effect of evaluating resource consumption by queries.
[0037] In an illustrative embodiment, the ranking of database nodes includes weighting based on current free space and projected availability time. As a result, the illustrative embodiment provides the technical effect of ranking database nodes based on availability.
[0038] In an illustrative embodiment, rerouting within the same database is based on a comparative analysis of resource capacity and historical performance trends. As a result, the illustrative embodiment provides the technical effect of rerouting queries to the most suitable node within the same database.
[0039] In an illustrative embodiment, the second LSTM cell identifies edge computing nodes based on proximity to a data source and available compute capacity. As a result, the illustrative embodiment provides the technical effect of reducing latency in query processing,
[0040] Various aspects of the present disclosure are described by narrative text, flowcharts, block diagrams of computer systems and / or block diagrams of the machine logic included in computer program product (CPP) embodiments. With respect to any flowcharts, depending upon the technology involved, the operations can be performed in a different order than what is shown in a given flowchart. For example, again depending upon the technology involved, two operations shown in successive flowchart blocks may be performed in reverse order, as a single integrated step, concurrently, or in a manner at least partially overlapping in time.
[0041] A computer program product embodiment (“CPP embodiment” or “CPP”) is a term used in the present disclosure to describe any set of one or more storage media (also called “mediums”) collectively included in a set of one or more storage devices that collectively include machine readable code corresponding to instructions and / or data for performing computer operations specified in a given CPP claim. A “storage device” is any tangible device that can retain and store instructions for use by a computer processor. Without limitation, the computer-readable storage medium may be an electronic storage medium, a magnetic storage medium, an optical storage medium, an electromagnetic storage medium, a semiconductor storage medium, a mechanical storage medium, or any suitable combination of the foregoing. Some known types of storage devices that include these mediums include: diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanically encoded device (such as punch cards or pits / lands formed in a major surface of a disc) or any suitable combination of the foregoing. A computer-readable storage medium, as that term is used in the present disclosure, is not to be construed as storage in the form of transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide, light pulses passing through a fiber optic cable, electrical signals communicated through a wire, and / or other transmission media. As will be understood by those of skill in the art, data is typically moved at some occasional points in time during normal operations of a storage device, such as during access, de-fragmentation, or garbage collection, but this does not render the storage device as transitory because the data is not transitory while it is stored.
[0042] With reference now to the figures, and in particular with reference to FIG. 1, a block diagram of a computing environment is depicted in accordance with an illustrative embodiment. Computing environment 100 contains an example of an environment for the execution of at least some of the computer code involved in performing the inventive methods, such as Long Short Term Memory (LSTM) 190. In addition to LSTM 190, computing environment 100 includes, for example, computer 101, wide area network (WAN) 102, end user device (EUD) 103, remote server 104, public cloud 105, and private cloud 106. In this embodiment, computer 101 includes processor set 110 (including processing circuitry 120 and cache 121), communication fabric 111, volatile memory 112, persistent storage 113 (including operating system 122 and LSTM 190, as identified above), peripheral device set 114 (including user interface (UI) device set 123, storage 124, and Internet of Things (IoT) sensor set 125), and network module 115. Remote server 104 includes remote database 130. Public cloud 105 includes gateway 140, cloud orchestration module 141, host physical machine set 142, virtual machine set 143, and container set 144.
[0043] Computer 101 may take the form of a desktop computer, laptop computer, tablet computer, smart phone, smart watch or other wearable computer, mainframe computer, quantum computer or any other form of computer or mobile device now known or to be developed in the future that is capable of running a program, accessing a network, or querying a database such as remote database 130. As is well understood in the art of computer technology, and depending upon the technology, performance of a computer-implemented method may be distributed among multiple computers and / or between multiple locations. On the other hand, in this presentation of computing environment 100, detailed discussion is focused on a single computer, specifically computer 101, to keep the presentation as simple as possible. Computer 101 may be located in a cloud, even though it is not shown in a cloud in FIG. 1. On the other hand, computer 101 is not required to be in a cloud except to any extent as may be affirmatively indicated.
[0044] Processor set 110 includes one or more computer processors of any type now known or to be developed in the future. Processing circuitry 120 may be distributed over multiple packages, for example, multiple coordinated integrated circuit chips. Processing circuitry 120 may implement multiple processor threads and / or multiple processor cores. Cache 121 is memory that is located in the processor chip package(s) and is typically used for data or code that should be available for rapid access by the threads or cores running on processor set 110. Cache memories are typically organized into multiple levels depending upon relative proximity to the processing circuitry. Alternatively, some, or all, of the cache for the processor set may be located “off chip.” In some computing environments, processor set 110 may be designed for working with qubits and performing quantum computing.
[0045] Computer-readable program instructions are typically loaded onto computer 101 to cause a series of operational steps to be performed by processor set 110 of computer 101 and thereby effect a computer-implemented method, such that the instructions thus executed will instantiate the methods specified in flowcharts and / or narrative descriptions of computer-implemented methods included in this document (collectively referred to as “the inventive methods”). These computer-readable program instructions are stored in various types of computer-readable storage media, such as cache 121 and the other storage media discussed below. The program instructions and associated data are accessed by processor set 110 to control and direct performance of the inventive methods. In computing environment 100, at least some of the instructions for performing the inventive methods may be stored in LSTM 190 in persistent storage 113. In an example embodiment, LSTM 190 includes program code for reducing deadlock and resource contention in temporary database storage.
[0046] Communication fabric 111 is the signal conduction path that allows the various components of computer 101 to communicate with each other. Typically, this fabric is made of switches and electrically conductive paths, such as the switches and electrically conductive paths that make up buses, bridges, physical input / output ports and the like. Other types of signal communication paths may be used, such as fiber optic communication paths and / or wireless communication paths.
[0047] Volatile memory 112 is any type of volatile memory now known or to be developed in the future. Examples include dynamic type random access memory (RAM) or static type RAM. Typically, volatile memory 112 is characterized by random access, but this is not required unless affirmatively indicated. In computer 101, volatile memory 112 is located in a single package and is internal to computer 101, but, alternatively or additionally, volatile memory 112 may be distributed over multiple packages and / or located externally with respect to computer 101.
[0048] Persistent storage 113 is any form of non-volatile storage for computers that is now known or to be developed in the future. The non-volatility of this storage means that the stored data is maintained regardless of whether power is being supplied to computer 101 and / or directly to persistent storage 113. Persistent storage 113 may be a read only memory (ROM), but typically at least a portion of the persistent storage allows writing of data, deletion of data, and re-writing of data. Some familiar forms of persistent storage include magnetic disks and solid state storage devices. Operating system 122 may take several forms, such as various known proprietary operating systems or open source Portable Operating System Interface-type operating systems that employ a kernel. The code included in LSTM 190 typically includes at least some of the computer code involved in performing the inventive methods.
[0049] Peripheral device set 114 includes the set of peripheral devices of computer 101. Data communication connections between the peripheral devices and the other components of computer 101 may be implemented in various ways, such as Bluetooth connections, Near-Field Communication (NFC) connections, connections made by cables (such as universal serial bus (USB) type cables), insertion-type connections (for example, secure digital (SD) card), connections made through local area communication networks and even connections made through wide area networks such as the internet. In various embodiments, UI device set 123 may include components such as a display screen, speaker, microphone, wearable devices (such as goggles and smart watches), keyboard, mouse, printer, touchpad, game controllers, and haptic devices. Storage 124 is external storage, such as an external hard drive, or insertable storage, such as an SD card. Storage 124 may be persistent and / or volatile. In some embodiments, storage 124 may take the form of a quantum computing storage device for storing data in the form of qubits. In embodiments where computer 101 is required to have a large amount of storage (for example, where computer 101 locally stores and manages a large database) then this storage may be provided by peripheral storage devices designed for storing very large amounts of data, such as a storage area network (SAN) that is shared by multiple geographically distributed computers. IoT sensor set 125 is made up of sensors that can be used in Internet of Things applications. For example, one sensor may be a thermometer and another sensor may be a motion detector.
[0050] Network module 115 is the collection of computer software, hardware, and firmware that allows computer 101 to communicate with other computers through WAN 102. Network module 115 may include hardware, such as modems or Wi-Fi signal transceivers, software for packetizing and / or de-packetizing data for communication network transmission, and / or web browser software for communicating data over the internet. In some embodiments, network control functions and network forwarding functions of network module 115 are performed on the same physical hardware device. In other embodiments (for example, embodiments that utilize software-defined networking (SDN)), the control functions and the forwarding functions of network module 115 are performed on physically separate devices, such that the control functions manage several different network hardware devices. Computer-readable program instructions for performing the inventive methods can typically be downloaded to computer 101 from an external computer or external storage device through a network adapter card or network interface included in network module 115.
[0051] WAN 102 is any wide area network (for example, the internet) capable of communicating computer data over non-local distances by any technology for communicating computer data, now known or to be developed in the future. In some embodiments, the WAN 102 may be replaced and / or supplemented by local area networks (LANs) designed to communicate data between devices located in a local area, such as a Wi-Fi network. The WAN and / or LANs typically include computer hardware such as copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers, and edge servers.
[0052] End User Device (EUD) 103 is any computer system that is used and controlled by an end user (for example, a customer of an enterprise that operates computer 101) and may take any of the forms discussed above in connection with computer 101. EUD 103 typically receives helpful and useful data from the operations of computer 101. For example, in a hypothetical case where computer 101 is designed to provide a recommendation to an end user, this recommendation would typically be communicated from network module 115 of computer 101 through WAN 102 to EUD 103. In this way, EUD 103 can display, or otherwise present, the recommendation to an end user. In some embodiments, EUD 103 may be a client device, such as a thin client, heavy client, mainframe computer, desktop computer, and so on.
[0053] Remote server 104 is any computer system that serves at least some data and / or functionality to computer 101. Remote server 104 may be controlled and used by the same entity that operates computer 101. Remote server 104 represents the machine(s) that collect and store helpful and useful data for use by other computers, such as computer 101. For example, in a hypothetical case where computer 101 is designed and programmed to provide a recommendation based on historical data, then this historical data may be provided to computer 101 from remote database 130 of remote server 104.
[0054] Public cloud 105 is any computer system available for use by multiple entities that provides on-demand availability of computer system resources and / or other computer capabilities, especially data storage (cloud storage) and computing power, without direct active management by the user. Cloud computing typically leverages sharing of resources to achieve coherence and economies of scale. The direct and active management of the computing resources of public cloud 105 is performed by the computer hardware and / or software of cloud orchestration module 141. The computing resources provided by public cloud 105 are typically implemented by virtual computing environments that run on various computers making up the computers of host physical machine set 142, which is the universe of physical computers in and / or available to public cloud 105. The virtual computing environments (VCEs) typically take the form of virtual machines from virtual machine set 143 and / or containers from container set 144. It is understood that these VCEs may be stored as images and may be transferred among and between the various physical machine hosts, either as images or after instantiation of the VCE. Cloud orchestration module 141 manages the transfer and storage of images, deploys new instantiations of VCEs and manages active instantiations of VCE deployments. Gateway 140 is the collection of computer software, hardware, and firmware that allows public cloud 105 to communicate through WAN 102.
[0055] Some further explanation of virtualized computing environments (VCEs) will now be provided. VCEs can be stored as “images.” A new active instance of the VCE can be instantiated from the image. Two familiar types of VCEs are virtual machines and containers. A container is a VCE that uses operating-system-level virtualization. This refers to an operating system feature in which the kernel allows the existence of multiple isolated user-space instances, called containers. These isolated user-space instances typically behave as real computers from the point of view of programs running in them. A computer program running on an ordinary operating system can utilize all resources of that computer, such as connected devices, files and folders, network shares, CPU power, and quantifiable hardware capabilities. However, programs running inside a container can only use the contents of the container and devices assigned to the container, a feature which is known as containerization.
[0056] Private cloud 106 is similar to public cloud 105, except that the computing resources are only available for use by a single enterprise. While private cloud 106 is depicted as being in communication with WAN 102, in other embodiments a private cloud may be disconnected from the internet entirely and only accessible through a local / private network. A hybrid cloud is a composition of multiple clouds of different types (for example, private, community or public cloud types), often respectively implemented by different vendors. Each of the multiple clouds remains a separate and discrete entity, but the larger hybrid cloud architecture is bound together by standardized or proprietary technology that enables orchestration, management, and / or data application portability between the multiple constituent clouds. In this embodiment, public cloud 105 and private cloud 106 are both part of a larger hybrid cloud.
[0057] Cloud Computing Services and / or Microservices: Public cloud 105 and private cloud 106 are programmed and configured to deliver cloud computing services and / or microservices (not separately shown in FIG. 1). Unless otherwise indicated, the word “microservices” shall be interpreted as inclusive of larger “services” regardless of size. Cloud services are infrastructure, platforms, or software that are typically hosted by third-party providers and made available to users through the internet. Cloud services facilitate the flow of user data from front-end clients (for example, user-side servers, tablets, desktops, laptops), through the internet, to the provider's systems, and back. In some embodiments, cloud services may be configured and orchestrated according to an “as a service” technology paradigm where something is being presented to an internal or external customer in the form of a cloud computing service. As-a-Service offerings typically provide endpoints with which various customers interface. These endpoints are typically based on a set of APIs. One category of as-a-service offering is Platform as a Service (PaaS), where a service provider provisions, instantiates, runs, and manages a modular bundle of code that customers can use to instantiate a computing platform and one or more applications, without the complexity of building and maintaining the infrastructure typically associated with these things. Another category is Software as a Service (SaaS) where software is centrally hosted and allocated on a subscription basis. SaaS is also known as on-demand software, web-based software, or web-hosted software. Four technological sub-fields involved in cloud services are: deployment, integration, on demand, and virtual private networks.
[0058] Illustrative embodiments provide a predictive and adaptive method and system designed to manage and optimize database query processing in cloud-based and edge computing environments. The illustrative embodiments address issues such as temporary database (temp DB) overflows and query deadlocks by leveraging LSTM (Long Short-Term Memory), real-time cloud resource monitoring and edge computing capabilities.
[0059] LSTM is a recurrent neural network (RNN), which is a deep learning model. As a subset of machine learning models, LSTM is effective at learning from large, complex datasets, especially those involving sequences or time-series data. LSTM retains information over long time intervals, making it suitable for learning patterns in sequential data such as database query logs. This capability enables identification of query behaviors that may lead to performance bottlenecks or system deadlocks.
[0060] In accordance with illustrative embodiments, one or more LSTM (Long Short-Term Memory) cells analyze the sequence and timing of queries that have historically resulted in temporary database (temp DB) overflows or deadlocks. By learning from these historical query patterns, the LSTM cells predict which individual queries or combinations of queries are likely to cause blocking or deadlock conditions in the future.
[0061] The illustrative embodiments incorporate proactive deadlock prediction. When the LSTM cells detect a high probability of an upcoming deadlock, they flag the query most likely to trigger the deadlock. In addition, the models identify other concurrent queries that are at risk of being affected or blocked.
[0062] The illustrative embodiments include dynamic resource reallocation using cloud and edge computing. The system monitors its environment to identify idle or underutilized database nodes within the same cloud-based database system that is experiencing high load or potential blocking. When such nodes are available and capable of processing queries, the LSTM cells proactively reroute the at-risk queries to these idle or less utilized nodes.
[0063] If no idle or underutilized nodes are available within the same cloud database, the LSTM cells expand their search to identify nearby edge computing nodes capable of processing the queries. Edge computing nodes are physically closer to the client systems and offer reduced latency, making them suitable alternatives.
[0064] As a result, if a potential deadlock is detected, the system proactively reallocates at-risk queries to available nodes within the same cloud database or edge resources, helping to prevent system disruption before it occurs.
[0065] The illustrative embodiments enable node monitoring and query scheduling using LSTM cells by processing real-time data from both cloud database nodes and edge computing nodes. This data includes current node utilization, trends in query processing times, and available compute capacity. By analyzing this information, the illustrative embodiments schedule queries across available nodes in real time, thereby optimizing overall performance and reducing the risk of overloads or bottlenecks.
[0066] FIG. 2 illustrates LSTM 200 which includes a first cell for query management and a second cell for load balancing.
[0067] LSTM 200 includes LSTM cell 202 configured for query management. LSTM cell 202 is trained to identify patterns and trends associated with query blocking events. Specifically, LSTM cell 202 analyzes the timing and sequence of queries that have historically resulted in blocked states or failures, particularly those that consume significant database bandwidth during specific times of day.
[0068] To build LSTM cell 202, a training dataset is created from historical query execution data spanning a defined time period. The dataset may include: specific queries executed; times of execution; resulting database state (e.g., blocked, failed); percentage likelihood of blocking based on query combinations. LSTM cell 202 captures long-term dependencies such as recurring patterns where specific sets of queries tend to run together and contribute to blocking conditions. The model processes sequences of data inputs including: total number of concurrently running queries; bandwidth consumed by each query; status of nodes processing the queries; database tables accessed and their sizes.
[0069] Based on these inputs, LSTM cell 202 outputs: (1) a probability score or percentage likelihood that a specific query, or combination of queries, will result in blocking or failure if executed in the observed sequence; (2) a prediction of which specific queries are most likely to cause the blocking; (3) an assessment of how query timing and concurrency patterns influence the overall system risk.
[0070] LSTM 200 includes LSTM cell 204 configured for load balancing. LSTM cell is trained to evaluate and monitor the operational status of other nodes within a database and edge computing nodes. LSTM cell 204 determines whether any other node in the local database cluster is currently idle or underutilized and thus available to process additional query load.
[0071] As a first step, LSTM cell 204 analyzes real-time and historical data for peer nodes within the database. This includes: whether other nodes are currently executing queries; typical completion times for those queries; current resource utilization levels (CPU, memory, I / O bandwidth); historical performance trends during similar workloads.
[0072] If LSTM cell 204 determines that no nodes within the database are available or suitable for load redistribution, it automatically expands its search scope to include edge computing nodes. These edge nodes are geographically closer to a client and may offer lower latency or improved responsiveness. LSTM cell 204 assesses edge node suitability based on similar criteria, such as availability, processing capability, and query-handling performance.
[0073] Based on the evaluation, LSTM cell 204 outputs: a ranked list of candidate nodes (from both the local database and edge nodes) that are most suitable for receiving redistributed queries; a real-time prediction of when a busy node is likely to become free; estimated query execution times if rerouted to a specific node; and an availability probability score for each node, indicating the likelihood it can process incoming queries without delay. When used in conjunction with LSTM 202 cell which predicts blocking or failure based on query sequences, LSTM cell 204 ensures that corrective action is taken proactively by reallocating queries to the most optimal nodes before performance degradation occurs.
[0074] The outputs of LSTM cells 202 and 204 are received by deployment engine 206. Deployment engine 206 includes deployer logic code configured to reroute queries to other nodes within the database cluster if other nodes are available. If other nodes within the database clusters are not available and a blocked query is time-series in nature (e.g., sensor data) and is lightweight in terms of resource usage, deployment engine 206 reroutes execution of the queries to an edge node which is closer to the data source, thus improving efficiency.
[0075] FIG. 3 illustrates LSTM cell 300 in accordance with an illustrative embodiment. LSTM cell 300 may be implemented as LSTM cell 202 shown in FIG. 2. For example, LSTM cell 300 may be implemented as LSTM 202, which analyzes the timing and sequence of queries that have historically resulted in blocked states or failures, particularly those that consume significant database bandwidth. LSTM cell 202 outputs: (1) a probability score or percentage likelihood that a specific query, or combination of queries, will result in blocking or failure if executed in the observed sequence; (2) a prediction of which specific queries are most likely to cause the blocking; (3) an assessment of how query timing and concurrency patterns influence the overall system risk.
[0076] LSTM cell 300 may also be implemented as LSTM cell 204 shown in FIG. 2. For example, LSTM cell 300 may be implemented as LSTM cell 204, which is trained to evaluate and monitor the operational status of other nodes within a database and edge computing nodes. LSTM cell 204 determines whether any other node in the database cluster is currently idle or underutilized and thus available to process additional query load. If LSTM cell 204 determines that no nodes within the database are available or suitable for load redistribution, it automatically expands its search scope to include edge computing nodes. These edge nodes are geographically closer to a client and may offer lower latency or improved responsiveness. LSTM cell 204 assesses edge node suitability based on similar criteria, such as availability, processing capability, and query-handling performance. Based on the evaluation, LSTM cell 204 outputs: a ranked list of candidate nodes (from both the local database and edge nodes) that are most suitable for receiving redistributed queries; a real-time prediction of when a busy node is likely to become free; estimated query execution times if rerouted to a specific node; and an availability probability score for each node, indicating the likelihood it can process incoming queries without delay.
[0077] With reference to FIG. 3, LSTM cell 300 includes forget gate 304 configured to determine what information should be discarded from a long-term memory at the current time step. As an example, the training data may include queries associated with jobs A, B, and C that typically run between 1 PM-2 PM and cause deadlocks. During live execution, LSTM cell 300 evaluates which queries are currently running. If LSTM cell 300 recognizes the same set of queries, it identifies them as blocking queries and retains the information. Otherwise, the data is discarded as irrelevant.
[0078] In some embodiments, forget gate 304 is governed by the following mathematical equation:ft=σ(xt*Uf+Ht-1*Wf), wherext=input to current time stamp (e.g., list of currently running jobs);
[0080] Uf=weight matrix for input (e.g., importance of current queries);
[0081] Ht-1=hidden state from previous time stamp (e.g., prior days'job activities);
[0082] Wf=weight matrix for hidden state (e.g., less importance for older information, such as 0.2;
[0083] σ=sigmoid function which ensures ft is between 0 and 1.
[0084] In an example embodiment, ft is multiplied with the previous cell state Ct-1 to determine what is retained or forgotten. LSTM cell 300 forgets everything from Ct-1 based on the following equation:Ct-1*ft=0, if ft=0.
[0085] Conversely, LSTM cell 300 retains everything from Ct-1 based on the following equation:Ct-1*ft=Ct-1, if ft=1
[0086] As an example, if a fourth job D is not running today but was in the training data, the forget gate assigns ft=0, discarding this job's information. If job D appears again, the forget gate assigns ft=1, retaining this job's information.
[0087] LSTM cell 300 includes input gate 306 configured to receive the output from forget gate 304 and determine what new information should be added to the cell state. As discussed before, if ft=0, forget gate 304 discards the information but if ft is 1, forget gate 304 forwards the information to input gate 306. The equation governing input gate 306 is:it=σ(xt*Ui+Ht-1*Wi), wherext=input at the current timestamp t (e.g., jobs A, B, C that are currently running between 1 PM-2 PM);
[0089] Ui: weight matrix applied to the current input xt (e.g., If the jobs are considered important for analysis (e.g., frequently causing deadlocks), a high weight might be assigned (e.g., 0.8).
[0090] Ht−1=hidden state from the previous timestamp (e.g., information from the previous day's jobs and their impact, such as which job ran on which node and if it caused a delay or deadlock);
[0091] Wi: weight matrix applied to the previous hidden state Ht−1 (e.g., If past data is somewhat relevant but less important than the current input, it may receive a lower weight (e.g., 0.2).
[0092] The sigmoid function σ applied to the result ensures that it falls between 0 and 1. This value determines how much of the new information should be allowed into the cell state.
[0093] Then, a candidate value Ct is generated using a tanh activation function, which considers both xt_and Ht−1. The tanh output ranges from −1 to 1:
[0094] Positive values (e.g., 0.6) indicate that this information should be added to the memory.
[0095] Negative values (e.g., −0.7) mean that the information should be reduced from the current memory.
[0096] The final update to the cell state is governed by the following equation:Ct=ft*Ct-1+it*Nt
[0097] LSTM cell 300 includes output gate 308 configured to control what information is sent out at the current step and used as input for the next step. In an example embodiment, output gate is governed by the following equation:Ot=σ(xt*U0+Ht-1*W0)
[0098] The current hidden state Ht is then computed as:Ht=ot*tanh(Ct)
[0099] LSTM cell 300 can also be implemented as LSTM 204 for load balancing functions. LSTM cell 300 can be trained on a set of data which includes queries that run on other nodes regularly and bandwidth consumed at each node. If there are new queries that do not run regularly, forget gate 304 discards the information. Information about other nodes, queries and bandwidth consumption is used to update the cell state of input gate 306. Based on the updated input gate 306, output gate 308 is updated to reflect available or free nodes, memories associated with free nodes and bandwidth necessary to run blocked queries. Based on the updated output gate 308, deployment engine 206 can reroute blocked queries to the free nodes.
[0100] If edge computing resources are available in the whole eco system, any query that is time-sensitive and does not involve large load can transferred to edge computing resources in a similar manner.
[0101] In an illustrative embodiment, the outputs of LSTM cells 202 and 204 are received by deployment engine 206. Deployment engine 206 includes deployer logic code configured to perform the following:
[0102] (1) if other nodes within the same database clusters are available, deployment engine matches highest-priority blocked queries to most available nodes; and
[0103] (2) assigns queries to these nodes in order of expected availability, maximizing throughput and minimizing delay.
[0104] In some embodiments, if edge computing is integrated into the whole eco-system and a blocked query is time-series in nature (e.g., sensor data, logs) and is lightweight in terms of resource usage, the deployment engine 206 reroutes execution of the queries to an edge node which is closer to the data source, thus improving efficiency.
[0105] FIG. 4 illustrates a flow diagram of process 400 in accordance with an illustrative embodiment. In block 402, time-series data indicating activity levels across a plurality of database nodes is received by a first LSTM cell. The time-series data indicating activity levels across a plurality of database nodes. In block 404, the time-series data is analyzed by the first LSTM cell to predict one or more queries that can cause blocks or deadlocks. Responsive to the prediction of blocked or deadlocked queries, in block 406, a second LSTM cell evaluates nodes within a database to determine if such nodes have capacity and availability to process the blocked or deadlocked queries. If such nodes within the database have the availability and capacity, in block 408 the blocked or deadlocked queries are rerouted to those nodes. If there are no nodes within the database having capacity and availability to process the blocked or deadlocked queries, in block 410 the second LSTM cell searches available edge computing resources. Upon identifying available edge computing resources, in block 412 the blocked or deadlocked queries are rerouted to the edge computing resources.
[0106] As used herein, a first component “connected to” a second component means that the first component can be connected directly or indirectly to the second component. In other words, additional components may be present between the first component and the second component. The first component is considered to be indirectly connected to the second component when one or more additional components are present between the two components. When the first component is directly connected to the second component, no additional components are present between the two components.
[0107] As used herein, the phrase “a number” means one or more. The phrase “at least one of”, when used with a list of items, means different combinations of one or more of the listed items may be used, and only one of each item in the list may be needed. In other words, “at least one of” means any combination of items and number of items may be used from the list, but not all of the items in the list are required. The item may be a particular object, a thing, or a category.
[0108] For example, without limitation, “at least one of item A, item B, or item C” may include item A, item A and item B, or item C. This example also may include item A, item B, and item C or item B and item C. Of course, any combinations of these items may be present. In some illustrative examples, “at least one of” may be, for example, without limitation, two of item A; one of item B; and ten of item C; four of item B and seven of item C; or other suitable combinations.
[0109] The flowcharts and block diagrams in the different depicted embodiments illustrate the architecture, functionality, and operation of some possible implementations of apparatuses and methods in an illustrative embodiment. In this regard, each block in the flowcharts or block diagrams may represent at least one of a module, a segment, a function, or a portion of an operation or step. For example, one or more of the blocks may be implemented as program code.
[0110] In some alternative implementations of an illustrative embodiment, the function or functions noted in the blocks may occur out of the order noted in the figures. For example, in some cases, two blocks shown in succession may be performed substantially concurrently, or the blocks may sometimes be performed in the reverse order, depending upon the functionality involved. Also, other blocks may be added in addition to the illustrated blocks in a flowchart or block diagram.
[0111] The description of the different illustrative embodiments has been presented for purposes of illustration and description and is not intended to be exhaustive or limited to the embodiments in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. Further, different illustrative embodiments may provide different features as compared to other illustrative embodiments. The embodiment or embodiments selected are chosen and described in order to best explain the principles of the embodiments, the practical application, and to enable others of ordinary skill in the art to understand the disclosure for various embodiments with various modifications as are suited to the particular use contemplated.
Claims
1. A computer-implemented method for query deployment in a database system, comprising:receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes;analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries;responsive to the detection of blocked or deadlocked queries, evaluating, by a second LSTM cell, nodes within a database to determine whether such nodes have capacity and availability to process the blocked or deadlocked queries;responsive to a determination that such nodes within the database have the availability and capacity, rerouting the blocked or deadlocked queries to those nodes;responsive to a determination that there are no nodes within the database having capacity and availability to process the queries, searching, by the second LSTM cell, for available edge computing resources; andupon identifying available edge computing resources, rerouting the blocked or deadlocked queries to the edge computing resources.
2. The computer-implemented method of claim 1, further comprising dispatching, by a deployment engine, the queries to the selected edge computing resources for execution.
3. The computer-implemented method of claim 1, further comprising generating, by the second LSTM cell, a ranked list of database nodes based on the availability and capacity.
4. The computer-implemented method of claim 1, wherein the first LSTM cell evaluates time-series metrics comprising CPU usage, memory consumption, and query duration.
5. The computer-implemented method of claim 1, wherein the ranking of database nodes includes weighting based on current free space and projected availability time.
6. The computer-implemented method of claim 1, wherein rerouting within the database is based on a comparative analysis of resource capacity and historical performance trends.
7. The computer-implemented method of claim 1, wherein the second LSTM cell identifies edge computing nodes based on proximity to a data source and available compute capacity.
8. The computer-implemented method of claim 1, wherein the edge rerouting is performed only when local database nodes are fully occupied or overloaded.
9. A computer system comprising:a processor set;one or more computer-readable storage media; andprogram instructions stored on the one or more storage media to cause the processor set to perform operations comprising:receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes;analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries;responsive to the detection of blocked or deadlocked queries, evaluating, by a second LSTM cell, nodes within a database to determine if such nodes have capacity and availability to process the blocked or deadlocked queries;if such nodes within the database have availability and capacity, rerouting the blocked or deadlocked queries to those nodes;if there are no nodes within the database having the capacity and availability to process the queries, searching, by the second LSTM cell, for available edge computing resources; andupon identifying available edge computing resources, rerouting the blocked or deadlocked queries to the edge computing resources.
10. The computer system of claim 9, wherein the operations further comprise dispatching, by a deployment engine, the queries to the selected edge computing resources for execution.
11. The computer system of claim 9, wherein the first LSTM cell evaluates time-series metrics comprising CPU usage, memory consumption, and query duration.
12. The computer system of claim 9, wherein the ranking of database nodes includes weighting based on current free space and projected availability time.
13. The computer system of claim 9, wherein the second LSTM cell identifies edge computing nodes based on proximity to a data source and available compute capacity.
14. The computer system of claim 9, wherein the edge rerouting is performed only when local database nodes are fully occupied or overloaded.
15. A computer program product comprising:one or more computer-readable storage media;program instructions stored on the one or more storage media to perform operations comprising:receiving, by a first LSTM cell, time-series data indicating activity levels across a plurality of database nodes;analyzing, by the first LSTM cell, the time-series data to detect one or more blocked or deadlocked queries;responsive to the detection of blocked or deadlocked queries, evaluating, by a second LSTM cell, nodes within a database to determine if such nodes have capacity and availability to process the blocked or deadlocked queries;if such nodes within the database have availability and capacity, rerouting the blocked or deadlocked queries to those nodes;if there are no nodes within the database having the capacity and availability to process the queries, searching, by the second LSTM cell, for available edge computing resources; andupon identifying available edge computing resources, rerouting the blocked or deadlocked queries to the edge computing resources.
16. The computer program product of claim 15, wherein the operations further comprise:dispatching, by a deployment engine, the queries to the selected edge computing resources for execution.
17. The computer program product of claim 15, wherein the first LSTM cell evaluates time-series metrics comprising CPU usage, memory consumption, and query duration.
18. The computer program product of claim 15, wherein the ranking of database nodes includes weighting based on current free space and projected availability time.
19. The computer program product of claim 15, wherein rerouting within the database is based on a comparative analysis of resource capacity and historical performance trends.
20. The computer program product of claim 15, wherein the second LSTM cell identifies edge computing nodes based on proximity to a data source and available compute capacity.
