Current website-based commerce applications typically communicate with a database system to operate to provide information and perform transactions with customers. As the number of customers visiting the website increase, the present systems are unable to scale to provide information, perform transactions, and provide personalized results to a customer. During high-demand times when many customers are attempting to access the website, there can be delays and system unavailability.
The accompanying drawings, which are included to provide a further understanding of the disclosed subject matter, are incorporated in and constitute a part of this specification. The drawings also illustrate implementations of the disclosed subject matter and together with the detailed description explain the principles of implementations of the disclosed subject matter. No attempt is made to show structural details in more detail than can be necessary for a fundamental understanding of the disclosed subject matter and various ways in which it can be practiced.
Various aspects or features of this disclosure are described with reference to the drawings, wherein like reference numerals are used to refer to like elements throughout. In this specification, numerous details are set forth in order to provide a thorough understanding of this disclosure. It should be understood, however, that certain aspects of disclosure can be practiced without these specific details, or with other methods, components, materials, or the like. In other instances, well-known structures and devices are shown in block diagram form to facilitate describing the subject disclosure.
Implementations of the disclosed subject matter may provide scaling of a database system to handle the number of requests by adding read-only standby nodes. The standby nodes of the database system may handle read-only requests, and a primary database node may handle write requests that are received. The standby nodes may replicate the data from the primary node. The number of standby nodes may be increased or decreased to manage operating costs.
Implementations of the disclose subject matter may determine whether to send a request to the primary node or the standby nodes. The request statement may be analyzed. Depending on whether previous transactions have been committed and propagated to the standby node, a current request may either be sent to the standby node (when data from earlier operations have been committed and have propagated to the standby node), or are sent to the primary node (when data has not been propagated to the standby node). That is, implementations of the disclosed subject matter may determine whether a request can be safely sent to standby node for read-only operation.
Implementations of the of disclosed subject matter may determine whether a request may be diverted to a standby node. One or more specific requests may be enabled to be diverted to the standby node. It may be determined whether a particular tenant related to the request is known, and whether the tenant is enabled to handle requests diverted to the standby node. It may be determined whether the tenant is known for a particular request to be diverted to the standby node.
Connections between a server and/or other device and the database system may be managed so that requests may select a connection from a connection pool for a duration of execution of a request. This management may minimize the number of connections, which may be costly, and where too many connections may cause a failure of the database system.
Implementations of the disclosed subject matter may distribute read requests across available standby nodes to achieve load balancing.
With current database systems, virtual machines of database instances could be statically provisioned to handle increased read-only operations to a database. Increasing the number of virtual machine resources in this manner is expensive, and the costs may vary depending how long the virtual machine is run, and how much it is used. As described throughout, implementations of the disclosed subject matter provide scaling of a database system to handle the number of requests by adding read-only standby nodes.
Implementations of the disclosed subject matter improve the function of a computing system by safely directing read-only requests to standby nodes of the database in order to handle increased traffic to the database system. The standby nodes may be dynamically adjusted to handle the changes in the number of read requests to the database system. In this arrangement, the database system may remain operational during high demand periods without crashing or delay to users.
The standby nodes may be dynamically added or removed based on the number of requests received by the database system. Standby nodes may replicate data from the primary node. There may be latency in replication of the data from the primary node to the standby nodes. Decisions of the database system on diverting received requests to the primary node or to a standby node may be based on the present request, and the state of replication of data between the primary node and the one or more secondary nodes.
When a request of the database system (e.g., structured query language (SQL) statement or the like) is executed, the request may be analyzed. Based at least in part on how the previous requests have been executed, the current request may be transmitted to the primary node or to the standby node. If the operation of the request includes a read-write operation, the request may be handled by the primary node. Read-only requests may be handled by one of the standby nodes. The decision to use standby node may be based at least in part on the state of the standby node. For example, if a portion of the data of the primary node has not been replicated to the standby node, the request may be transmitted to the primary database node, even if the operation of the request is a read-only operation. Read requests may be distributed across available standby nodes to achieve balance.
At operation 120, the database system may determine whether a previous transaction has been committed to the primary node (e.g., primary node 902 shown in
At operation 130, the database system may determine whether the request is a read-only request for data from the database system or whether the request includes a write operation. When the request is determined to be a read-only request and the previous transaction has been replicated to the standby node (e.g., as determined by the database system in operation 120), the request may be transmitted to one of the one or more standby nodes (e.g., standby nodes 904, 906, and/or 908 shown in
That is, operations 140 and 150 may be performed by the database system to determine whether to divert the request to a standby node based on whether pervious transaction data has been replicated to the standby node from the primary node. In some implementations of method 100, when the request is determined by the database system to include a write operation, the write operation may be performed at the primary node of the database system.
As shown in
As shown in
As shown in
As shown in
As shown in
As shown in
The example operations of method 100 shown in
For example, a filter named SystematicDiversionFilter may divert requests to standby nodes of the database system based on one or more configuration rules (e.g., one or more of the operations detailed in
The status of the database system may be determined during an application startup (e.g., an application that may be a commerce application, a web-based storefront, or the like that may be communicatively coupled to the database system) and/or connection pool initialization. The connection pool initialization may include a discovery of the topology of the database system, such as the primary node and/or the number of standby nodes, and/or the capacity of one or more of the nodes. For example, when establish a connection with the database system to process a request, if a useTrafficDivertingConnections is enabled, a TrafficDivertingConnectionPool is initialized, and may return an instance of TrafficDivertingDatabaseConnectionProxy. When a connection is created, it may be placed within a connection pool of the database system, where a request may use a connection from the connection pool when it is needed for the duration of execution of the request. In some implementations, a connection pool management layer of the database system may manage the connection pool. For example, the connection pool management layer may monitor the number of connections, and may reduce the number of connections when one or more connections have not been utilized within a predetermined period of time. The connection pool management layer may manage the number of connections in the connection pool to prevent failure and/or instability of the database system from having a connection amount that exceeds a predetermined number of connections.
An example configuration for a database system to handle requests and safely divert at least some requests to one or more standby nodes is shown in Table 1 below. That is, the configuration in Table 1, along with the example operations shown in
Implementations of the disclosed subject matter may provide a way to determine what node to send a request. The request may be analyzed to determine the operation to be performed, the tenant involved with the request, and the like. Implementations of the disclosed subject matter may check for any dependencies of the present request. For example, a selection in an application that is executed by a server (e.g., server 700 and/or 800 shown in
Implementations of the presently disclosed subject matter may be implemented in and used with a variety of component and network architectures.
As shown in
The storage 710 of the server 700, the storage 810 of the server 800, and/or the database 900, may store data for one or more instances of the application, updates for the application, and the like. Further, if the storage 710, storage 910, and/or database 800 is a multitenant system, the storage 710, storage 910, and/or database 800 can be organized into separate log structured merge trees for each instance of a database for a tenant. Alternatively, contents of all records on a particular server or system can be stored within a single log structured merge tree, in which case unique tenant identifiers associated with versions of records can be used to distinguish between data for each tenant as disclosed herein. More recent transactions can be stored at the highest or top level of the tree and older transactions can be stored at lower levels of the tree. Alternatively, the most recent transaction or version for each record (i.e., contents of each record) can be stored at the highest level of the tree and prior versions or prior transactions at lower levels of the tree.
The computer (e.g., user computer, enterprise computer, or the like) 500 may include a bus 510 which interconnects major components of the computer 500, such as a central processor 540, a memory 570 (typically RAM, but which can also include ROM, flash RAM, or the like), an input/output controller 580, a user display 520, such as a display or touch screen via a display adapter, a user input interface 560, which may include one or more controllers and associated user input or devices such as a keyboard, mouse, Wi-Fi/cellular radios, touchscreen, microphone/speakers and the like, and may be communicatively coupled to the I/O controller 580, fixed storage 530, such as a hard drive, flash storage, Fibre Channel network, SAN device, SCSI device, and the like, and a removable media component 550 operative to control and receive an optical disk, flash drive, and the like.
The bus 510 may enable data communication between the central processor 540 and the memory 570, which may include read-only memory (ROM) or flash memory (neither shown), and random access memory (RAM) (not shown), as previously noted. The RAM may include the main memory into which the operating system, development software, testing programs, and application programs are loaded. The ROM or flash memory can contain, among other code, the Basic Input-Output system (BIOS) which controls basic hardware operation such as the interaction with peripheral components. Applications resident with the computer 500 may be stored on and accessed via a computer readable medium, such as a hard disk drive (e.g., fixed storage 530), an optical drive, floppy disk, or other storage medium 550.
The fixed storage 530 can be integral with the computer 500 or can be separate and accessed through other interfaces. The fixed storage 530 may be part of a storage area network (SAN). A network interface 590 can provide a direct connection to a remote server via a telephone link, to the Internet via an internet service provider (ISP), or a direct connection to a remote server via a direct network link to the Internet via a POP (point of presence) or other technique. The network interface 590 can provide such connection using wireless techniques, including digital cellular telephone connection, Cellular Digital Packet Data (CDPD) connection, digital satellite data connection or the like. For example, the network interface 590 may enable the computer to communicate with other computers and/or storage devices via one or more local, wide-area, or other networks, such as communications network 600.
Many other devices or components (not shown) may be connected in a similar manner (e.g., data cache systems, application servers, communication network switches, firewall devices, authentication and/or authorization servers, computer and/or network security systems, and the like). Conversely, all the components shown in
Some portions of the detailed description are presented in terms of diagrams or algorithms and symbolic representations of operations on data bits within a computer memory. These diagrams and algorithmic descriptions and representations are commonly used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here and generally conceived to be a self-consistent sequence of steps leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
It should be borne in mind, however, that all these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the above discussion, it is appreciated that throughout the description, discussions utilizing terms such as “receiving,” “determining,” “transmitting,” “performing,” “adding,” “removing,” “distributing,” or the like, refer to the actions and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (e.g., electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
More generally, various implementations of the presently disclosed subject matter can include or be implemented in the form of computer-implemented processes and apparatuses for practicing those processes. Implementations also can be implemented in the form of a computer program product having computer program code containing instructions implemented in non-transitory and/or tangible media, such as hard drives, solid state drives, USB (universal serial bus) drives, CD-ROMs, or any other machine readable storage medium, wherein, when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing implementations of the disclosed subject matter. Implementations also can be implemented in the form of computer program code, for example, whether stored in a storage medium, loaded into and/or executed by a computer, or transmitted over some transmission medium, such as over electrical wiring or cabling, through fiber optics, or via electromagnetic radiation, wherein when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing implementations of the disclosed subject matter. When implemented on a general-purpose microprocessor, the computer program code segments configure the microprocessor to create specific logic circuits. In some configurations, a set of computer-readable instructions stored on a computer-readable storage medium can be implemented by a general-purpose processor, which can transform the general-purpose processor or a device containing the general-purpose processor into a special-purpose device configured to implement or carry out the instructions. Implementations can be implemented using hardware that can include a processor, such as a general purpose microprocessor and/or an Application Specific Integrated Circuit (ASIC) that implements all or part of the techniques according to implementations of the disclosed subject matter in hardware and/or firmware. The processor can be coupled to memory, such as RAM, ROM, flash memory, a hard disk or any other device capable of storing electronic information. The memory can store instructions adapted to be executed by the processor to perform the techniques according to implementations of the disclosed subject matter.
The foregoing description, for purpose of explanation, has been described with reference to specific implementations. However, the illustrative discussions above are not intended to be exhaustive or to limit implementations of the disclosed subject matter to the precise forms disclosed. Many modifications and variations are possible in view of the above teachings. The implementations were chosen and described to explain the principles of implementations of the disclosed subject matter and their practical applications, to thereby enable others skilled in the art to utilize those implementations as well as various implementations with various modifications as can be suited to the particular use contemplated.
Number | Name | Date | Kind |
---|---|---|---|
7627726 | Chandrasekaran | Dec 2009 | B2 |
7987210 | Wei | Jul 2011 | B1 |
7987470 | Wei | Jul 2011 | B1 |
8150887 | Wei | Apr 2012 | B1 |
8171006 | Wei | May 2012 | B1 |
8171054 | Wei | May 2012 | B1 |
8244778 | Wei | Aug 2012 | B1 |
8255426 | Wei | Aug 2012 | B1 |
8275808 | Wei | Sep 2012 | B2 |
8375015 | Wei | Feb 2013 | B2 |
8560572 | Wei | Oct 2013 | B2 |
8595265 | Wei | Nov 2013 | B2 |
8656410 | Wei | Feb 2014 | B1 |
8694546 | Wei | Apr 2014 | B2 |
8930336 | Wei | Jan 2015 | B2 |
8949282 | Wei | Feb 2015 | B1 |
9009731 | Wei | Apr 2015 | B2 |
9547689 | Chandrasekaran | Jan 2017 | B2 |
9760623 | Wei | Sep 2017 | B2 |
10078618 | Chandrasekaran | Sep 2018 | B2 |
10652246 | Chandrasekaran | May 2020 | B2 |
10693709 | Chainani | Jun 2020 | B2 |
10726053 | Wei | Jul 2020 | B2 |
11151150 | Obembe | Oct 2021 | B2 |
11165857 | Obembe | Nov 2021 | B2 |
20050071391 | Fuerderer | Mar 2005 | A1 |
20120239697 | Ram | Sep 2012 | A1 |
20120290714 | Cohen | Nov 2012 | A1 |
20130060815 | Saeki | Mar 2013 | A1 |
20170147527 | Chandrasekaran | May 2017 | A1 |
20190306008 | Chainani | Oct 2019 | A1 |
20200137084 | Roy | Apr 2020 | A1 |
20200342008 | Wei | Oct 2020 | A1 |
20210089910 | Zheng | Mar 2021 | A1 |
20210126964 | Obembe | Apr 2021 | A1 |
Entry |
---|
Seonmyeong Bak; Multi-level Load Balancing with an Integrated Runtime Approach; IEEE; pp. 31-40 (Year: 2018). |
Number | Date | Country | |
---|---|---|---|
20230195738 A1 | Jun 2023 | US |