This application claims priority to U.S. patent application Ser. No. 10/746,977, “Cluster Extension in Distributed Systems Using Tree Method”, to Ivan Schreter, which was filed on Dec. 24, 2003; the disclosure of the prior application is considered part of and is incorporated by reference in the disclosure of this application.
The present invention relates to data processing by digital computer, and more particularly to address generation and cluster extension in distributed systems.
Data used by computer program applications is often structured as and represented by data objects, and applications generally write and read data objects to and from a database.
In a common data storage architecture, a data storage system includes one or more front-end servers (“front ends”), each of which communicates with a cluster of back-end servers (“back ends”). The back-end servers store data objects and are organized into one or more nodes or groups. A node is a group of servers that mirror each other, e.g., that contain the same database fragment. (The term “server” will be understood to refer to a back-end server unless the context indicates otherwise.) While technically a node can have only a single server, there should be at least two servers in each node to achieve high availability. The cluster is a potentially distributed system of back-end servers. The front-end server is a server that communicates with the back-end servers and operates to provide an interface between the cluster and applications.
Over time, the load on individual servers within the cluster will tend to increase. This is due to several factors, such as a reduction in the free capacity of each server as data objects accumulate on it, and more frequent accesses of each server by computer applications as more and more data objects are located on it. The capacity of the cluster will need to be expanded when the load becomes too great.
A common approach to increasing the capacity of a cluster is to add a new server to the cluster. This generally requires moving some data objects to the new server, which can involve rehashing the database. This is especially problematic in object-oriented databases, where the data objects must be identified by an object identifier that does not change during the lifetime of the data object.
The invention provides methods, systems, and apparatus, including computer program products, for address generation and cluster extension in distributed data storage systems.
In general, in one aspect, the invention provides a method for managing data storage servers. The method includes establishing a cluster of back-end servers organized into nodes, every node in the cluster having a node identifier that is unique in the cluster, every back-end server in any node mirroring every other back-end server in the same node; establishing a predefined set of ultimate identifiers for nodes that could be created in the cluster; and storing every new data object on the cluster on a particular node, the particular node having a particular node identifier that identifies a subset of the set of ultimate identifiers, and providing for the object a universal identifier that combines (i) an object identifier that is unique on the particular node and (ii) a server identifier, where the server identifier is one of the ultimate identifiers in the subset, and where the node identifiers for nodes existing in the cluster at any one time identify non-overlapping subsets of the set of ultimate identifiers.
The method can be implemented to include one or more of the following advantageous features. The set of ultimate identifiers is a set of binary numbers of a fixed length; and each node in the cluster has a node identifier that is a binary number of the fixed length or of a length less than the fixed length. The set of ultimate identifiers is the set of 32-bit binary numbers; and the object identifier is a 32-bit binary number. Each node identifier identifies a subset of the set of ultimate identifiers by being a beginning part or an ending part of each identifier in the subset or by being the only identifier in the subset. The particular node identifier is not an ultimate identifier; and the server identifier includes a part generated as a pseudo-random value. The pseudo-random value is generated by a back-end server. The pseudo-random value is generated by a front-end server. The method further includes splitting a first node into new nodes, where the first node had a first node identifier that identified a first subset of the set of ultimate identifiers, the new nodes each have a distinct node identifier that identifies a new distinct subset of the first subset, and the union of the new distinct subsets is the first subset; assigning to each new node at least one of the back-end servers of the first node; and removing from each back-end server of each new node any data objects that have a server identifier that does not correspond to the node identifier for the new node to which the back-end server is assigned. The set of ultimate identifiers is a set of binary numbers of a fixed length; the first node has a first node identifier that is a binary number of a length less than the fixed length; and the node identifier of each new node includes within it the binary number of the first node identifier. The method further includes using a load measured for each node in the cluster in selecting the first node as a node to be split. The method further includes determining whether the first node has fewer than four back-end servers and, if it does, adding back-end servers to the first node so that the first node has at least four back-end servers, and then populating the added back-end servers with all of the data objects stored on the first node, before splitting the first node.
In general, in another aspect, the invention features a method for generating an identifier for a new data object to be stored in a cluster of back-end servers of the kind where the cluster is organized into nodes and every node in the cluster has a node identifier that is unique in the cluster, and where every back-end server in any node mirrors every other back-end server in the same node. The method includes generating a universal identifier for a new data object, the universal identifier having a node identifier part that uniquely identifies a first node in the cluster, a reserve part, and an object identifier part that uniquely identifies the object in the first node, the reserve part being at least in part generated as a pseudo-random value.
The method can be implemented to include one or more of the following advantageous features. The node identifier part and the reserve part have a combined length that is a predetermined fixed length; and the object identifier part does not uniquely identify the new data object on the cluster. The reserve part is generated by the first node and given a value to maintain some locality between the new data object and certain other data objects stored on the first node. The node identifier part and the reserve part are both generated as pseudo-random values. The node identifier part is modified for load balancing. The node identifiers have a structure represented as a binary tree in a front-end server, and load balancing includes navigating the binary tree to select a node based on the relative loads on the nodes of the cluster.
In general, in other aspects, the invention features computer program products and systems implementing the features of the foregoing methods.
The invention can be implemented to realize one or more of the following advantages. Data objects are addressed in such a way that it is simple to add a new node to a cluster. Operation of the expansion mechanism naturally tends to keep the data and processing load relatively well balanced. It is unnecessary to redistribute data after a new server is added to a cluster.
The details of one or more embodiments of the invention are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the invention will be apparent from the description, drawings, and claims.
Like reference symbols in the various drawings indicate like elements.
One property of each data object is the address by which it is identified in the cluster. Object 131 is identified by a universal identifier 141. The universal identifier has two parts, the server ID and the object ID. The server ID has a part that is used and represents the actual node in which the object is currently stored (e.g., that represents node 121 for object 131) and will generally have a part that is currently unused and reserved for use if the node is later split. The object ID is an identifier that identifies the object uniquely on a back-end server, i.e., uniquely on the node on which the object is stored. The universal identifier, on the other hand, is universal in the sense that is unique on the cluster as a whole; it is an address a front-end server can use to address the object. In addition, it is desirable that the universal identifier remain unchanged during the lifetime of the object, even if its node is split. This is a feature of the techniques that will be described.
It is not necessary that the parts of the universal identifier have any particular arrangement, or that the universal identifier be of any particular size. For ease of exposition, however, an advantageous implementation will now be described in which the universal identifier has the fixed size of 64 bits, 32 bits for the server ID and 32 bits for the object ID, and in which the used part (the node ID) of the server ID is stored as the prefix or leading part of the server ID, and the unused part, if any, is stored as the suffix or trailing part of the server ID. This arrangement allows nodes to be organized easily in a binary tree structure in which it is simple to add new nodes by splitting.
In this implementation, as illustrated in
Node status information is associated with each node in the tree. In the present implementation, this information includes four values, as illustrated in node 202. These are the aggregate data size, the aggregate data capacity, the aggregate CPU load, and the aggregate CPU capacity of the node. These values are updated from time to time to provide the data for optimization and load balancing in connection with address generation. The updating can be provided asynchronously by the back-end servers or requested periodically by the front-end server or servers. As noted earlier, there may be more than one front-end server, in which case each front-end server has a private copy of this tree.
Before a new object can be stored, it must have a universal identifier (“universal ID”). The object ID part of the universal ID can be generated by a back-end server after the node on which the object will be stored has been selected. The server ID part can be generated by a front-end server to combine the node ID for the node selected to store the object and a generated unused (trailing) part that has a random value.
As shown in
In one alternative, a process for balancing the load on the nodes is based on data size. The process traverses the tree from its root. For each level in the tree, the process determines whether to use the “0” or the “1” path based on free capacity in both paths. Let c0 be the free capacity (in percent) of the “0” path and c1, the free capacity of the “1” path. Then, the “0” path is selected with probability (in percent) of c0/(c0+c1). When a node (leaf in the tree) is reached, that node has been selected, and the generated node address for the new object is modified accordingly. Optionally, a minimum and maximum probability limit is established to prevent imbalance in an almost empty system and overflow of a node in an almost full system.
In another alternative, a process for balancing the load on the nodes is based on server process (“CPU”) load and operates along the lines just described, using CPU capacity rather than data capacity. In a further alternative, a metric based on both CPU and data size is used.
The selected node or a server in the selected node may optionally also change the reserved bits of the server ID to achieve good data locality (step 308). If the selected node is split one or more times, one or more of the reserved bits will be used to identify the node on which the object is stored, as will be described below. For consistency with the description above, this bit or these bits will be referred to as the leading reserve bit or bits. To provide data locality for a set of objects, the server can give one or more of the leading reserve bits of the universal IDs of the set of objects the same value, so that they will stay together across one or more splittings of the node.
In an alternative implementation, no preliminary node server ID is generated; rather, the node for the new object is selected directly. This can be done using a load balancing algorithm, e.g. one of the ones described above. The reserve bits of the server ID can be generated as a pseudo-random number at the same time. Alternatively, the reserve bits can be generated by a back-end server in the first instance. In any event, a back-end server will generate the object ID part of the universal ID.
When a node (i.e., each server in the node) has insufficient data storage space, the node may be split. Because the universal identifier and, more particularly, the server ID, has a fixed length, the server ID uniquely identifies one node among all nodes that could be created in the cluster, and also uniquely identifies one node among all nodes that might exist at any time in the cluster.
Splitting an original node will create from one leaf in the node tree (illustrated in
To the extent data had been distributed uniformly, each new node will be the correct storage place of about half of the original data. This causes a maximum unbalance of about 1:2 in the use of data capacity between different nodes. However, a load-balancing process for adding new objects to the system will tend to equalize this imbalance. Splitting a node that was split a short time before would create an imbalance bigger than 1:2. However, it is unlikely that a newly created split node will be selected to be split in a short time and before it is fully loaded. For this reason, the backend tree will stay more or less balanced as new nodes are added.
As shown in
Returning to
Immediately after the new nodes are created, each new node will have all the objects that were stored on the original node, some of which will belong on one new node and others of which will belong on the other new node. Although the universal ID, including the server ID, of an object does not change, the used part, which is recognized as the node ID, will increase as a bit is, in effect, taken from the reserved bits and added to the node ID. At this point, a background process can be started to clean up each new node and delete objects that do not belong on the new node (step 408) according to the server IDs of the objects. The end result is that each of the objects from the original node remains stored on exactly one of the new nodes. While this is being done, the cluster can be used normally, and new objects can be added even to the new nodes as they are being cleaned up.
When the properties of a cluster are established, a set of what will be referred to as ultimate identifiers is defined. These are referred to as ultimate identifiers because they are the node identifiers for the nodes that will exist when all possible node splitting has been done; in the implementation described above, this corresponds to the ultimate state of the node tree. In every earlier state of the node tree and the cluster, some or all of the node IDs will represent or correspond to a subset of multiple ultimate identifiers, and in the ultimate state, each node ID represents or corresponds to a subset of one ultimate identifier.
In these terms, as shown in
The invention can be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. The invention can be implemented as a computer program product, i.e., a computer program tangibly embodied in an information carrier, e.g., in a machine-readable storage device or in a propagated signal, for execution by, or to control the operation of, data processing apparatus, e.g., a programmable processor, a computer, or multiple computers. A computer program can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed across multiple sites and interconnected by a communication network.
Method steps of the invention can be performed by one or more programmable processors executing a computer program to perform functions of the invention by operating on input data and generating output. Method steps can also be performed by, and apparatus of the invention can be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. Information carriers suitable for embodying computer program instructions and data include all forms of non-volatile memory, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in special purpose logic circuitry.
The invention can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the invention, or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (“LAN”) and a wide area network (“WAN”), e.g., the Internet.
The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
A number of embodiments of the invention have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. For example, steps of the described methods can be performed in different orders and still achieve useful results. Accordingly, other embodiments are within the scope of the following claims.
Number | Date | Country | |
---|---|---|---|
Parent | 10746977 | Dec 2003 | US |
Child | 13356238 | US |