HK1228057B - Database management system - Google Patents
Database management system Download PDFInfo
- Publication number
- HK1228057B HK1228057B HK17101723.3A HK17101723A HK1228057B HK 1228057 B HK1228057 B HK 1228057B HK 17101723 A HK17101723 A HK 17101723A HK 1228057 B HK1228057 B HK 1228057B
- Authority
- HK
- Hong Kong
- Prior art keywords
- atom
- node
- transaction
- nodes
- atoms
- Prior art date
Links
Description
分案说明Description of the case
本申请属于申请日为2011年3月18日的中国发明专利申请201180014604.6的分案申请。This application is a divisional application of Chinese invention patent application No. 201180014604.6, filed on March 18, 2011.
技术领域Technical Field
本发明总体上涉及数据库管理系统。更具体地,本发明涉及一种方法和设备,用于实现多用户、弹性的、按需的分布式关系数据库管理系统,其特征在于原子性、性能和可扩展性。The present invention relates generally to database management systems and, more particularly, to a method and apparatus for implementing a multi-user, elastic, on-demand distributed relational database management system characterized by atomicity, performance, and scalability.
背景技术Background Art
在过去这些年中,用于存储和检索消息的数据库的使用已经在大量的商业应用中显现为重要的工具。初始,许多数据库系统在具有多个用户的单个服务器装置上操作。然而,在过去这些年中,各种因素已经产生,它们要求数据库架构的基本特性改变。作为第一因素,数据库存储要求已经变得极大。其次,试图访问这样的数据库的用户的数量也已经变大。第三,用于检索具有最小的更新的相对稳定的数据的数据库的使用已经被替换为事务处理。Over the past few years, the use of databases for storing and retrieving information has become an important tool in a wide range of business applications. Initially, many database systems operated on a single server device with multiple users. However, over the past few years, various factors have arisen that have required fundamental changes in database architecture. First, database storage requirements have become extremely large. Second, the number of users attempting to access such databases has also increased. Third, the use of databases for retrieving relatively stable data with minimal updates has been replaced by transaction processing.
事务是必须整体完成的工作的单位。单个事务可以包括多个数据操纵。例如,单个事务可以包括读取操作,随后是写入操作。近年来,大量的努力已经针对使得关系数据库能够支持日益增长的事务处理的速率。A transaction is a unit of work that must be completed in its entirety. A single transaction can include multiple data manipulations. For example, a single transaction might include a read operation followed by a write operation. In recent years, significant effort has been directed toward enabling relational databases to support increasing transaction processing rates.
现在通过限定ACID属性的标准来判断数据库,该ACID属性即原子性、一致性、隔离性和持久性。原子性确保以其整体来完成所有的事务任务。一致性保证仅有效的数据被写入数据库。隔离性保证其他操作在事务期间不能访问或“观看”在中间状态中的数据。持久性保证一旦已经成功地处理了事务,则它不能被复原。Databases are now judged by the standards defining the ACID properties: atomicity, consistency, isolation, and durability. Atomicity ensures that all transaction tasks are completed in their entirety. Consistency ensures that only valid data is written to the database. Isolation ensures that other operations cannot access or "see" data in an intermediate state during a transaction. Durability ensures that once a transaction has been successfully processed, it cannot be reversed.
一致性在多用户系统中特别重要,在多用户系统中,两个或更多的用户可能寻求对于共享的易失性数据的同时访问。早期的多用户系统使用锁定操作来保证一致性。锁定可以是排他的或写入的锁定或者是非排他的或读取的锁定,并且可以被应用到单独的记录或被应用到页面。然而,当数据库在大小上已经增大时并且当事务速率已经提高时,用于管理锁定的开销已经变得显著,并且在一些情况下已经变为禁止性的。Consistency is particularly important in multi-user systems, where two or more users may seek simultaneous access to shared, volatile data. Early multi-user systems used locking operations to ensure consistency. Locks can be exclusive or write locks or non-exclusive or read locks, and can be applied to individual records or to pages. However, as databases have grown in size and transaction rates have increased, the overhead of managing locks has become significant and, in some cases, prohibitive.
多版本并发控制(MVCC)是用于保证同时性的替代处理。对于复杂数据库,MVCC可以比锁定更有效。MVCC使用时间戳或增加的事务标识(ID)来串行化记录的不同版本。每一个版本允许事务读取在时间戳或ID前的对象的最近版本。利用该控制方法,其他用户将看不到例如对于记录的任何改变,直到提交了该改变。MVCC也消除了具有其他附加的开销的锁定,并且建立了其中读取操作不能阻挡写入操作的系统。Multi-version concurrency control (MVCC) is an alternative process for ensuring concurrency. For complex databases, MVCC can be more efficient than locking. MVCC uses timestamps or incremental transaction identifiers (IDs) to serialize different versions of a record. Each version allows a transaction to read the most recent version of the object before the timestamp or ID. With this control method, other users will not see any changes to a record, for example, until the change is committed. MVCC also eliminates locking, which has other additional overhead, and creates a system where read operations cannot block write operations.
除了满足ACID测试之外,现在存在对于针对用户的连续可用性的要求。一些数据库系统将一个计算机系统专用于事务处理,并且将另一个专用于决定支持和其他报告处理。它们互连使得可以同时支持其他功能。随着数据库在大小和复杂度上增大,现有的数据处理系统被替换为更强大的数据处理系统。用于适应于增长的另一种手段涉及复制系统,其中,一个机器被指定为“头”机器,其使所有的复制机器保持同步。如果头机器故障,则处理将那个功能分配给另一个复制机器。不同的复制机器可用于特定用户。该手段不是可扩展的,因为所有的机器必须具有相同的能力。In addition to meeting the ACID test, there is now a demand for continuous availability to users. Some database systems dedicate one computer system to transaction processing and another to decision support and other reporting processing. They are interconnected so that other functions can be supported simultaneously. As databases grow in size and complexity, existing data processing systems are replaced with more powerful data processing systems. Another means of adapting to growth involves a replication system, in which one machine is designated as the "head" machine, which keeps all the replica machines synchronized. If the head machine fails, the process assigns that function to another replica machine. Different replica machines can be used for specific users. This approach is not scalable because all machines must have the same capabilities.
作为另一种手段,可以将多个自治数据库系统整合为单个“联合”数据库,该单个“联合”数据库具有计算机网络,该计算机网络互连各个独立的数据库。联合数据库要求“中间件”来将构成的数据库保持同步。这个“中间件”可以变得很复杂。当数据库大小增大时,操作中间件所需要的资源可能施加足以使得整体系统性能变差的大的开销。Alternatively, multiple autonomous database systems can be consolidated into a single "federated" database, using a computer network that interconnects the individual databases. A federated database requires "middleware" to synchronize the constituent databases. This "middleware" can become quite complex. As the database size increases, the resources required to operate the middleware can impose significant overhead, potentially degrading overall system performance.
“分区”是用于实现数据库的另一种手段,在该数据库中,逻辑数据库或其构成元素被划分为不同的独立部分。在分布式数据库管理系统中,每一个分区可以在多个节点上扩展。在给定节点的用户可以对于该分区执行局部事务。也可以通过形成较小的数据库或通过分割仅一个表格的选择的元素来实现分区。Partitioning is another method for implementing a database, in which the logical database or its constituent elements are divided into distinct, independent parts. In a distributed database management system, each partition can be spread across multiple nodes. Users at a given node can execute local transactions for that partition. Partitioning can also be achieved by forming smaller databases or by splitting only selected elements of a table.
对于分区存在两种一般的手段。在也被称为“分片”的水平分区中,将不同的行置于不同的表格和不同的服务器中。一般,它们具有特定的共性,诸如邮政编码的范围或按照范围划分为不同表格的姓。例如,第一数据库可能包括用于在范围A至M中的姓的所有记录;第二数据库针对在范围N至Z中。作为一种形式的水平分区的分片涉及将数据库的行定位在分离的服务器上。分片不计算在每一个表格中的行的数量,并且提高搜索性能。然而,分片在应用级使用散列码,这使得其太难以实现。它也包含两阶段递交。分片的复杂性使得其适合于特定应用,因为用于限定分片的基础被良好地限定。There are two general approaches to partitioning. In horizontal partitioning, also known as "sharding," different rows are placed in different tables and on different servers. Typically, they have certain characteristics in common, such as ranges of postal codes or surnames divided into different tables by range. For example, a first database might include all records for surnames in the range A to M; a second database for those in the range N to Z. Sharding, as a form of horizontal partitioning, involves locating the rows of the database on separate servers. Sharding does not count the number of rows in each table and improves search performance. However, sharding uses hash codes at the application level, which makes it difficult to implement. It also involves a two-phase commit. The complexity of sharding makes it suitable for specific applications because the basis for defining the shards is well defined.
垂直分区包含创建具有较少的列并且在表格上分割列的表格。象联合数据库那样,垂直分区需要中间件来确定如何将对于特定字段的任何请求路由到适当的分区。另外,这些系统使用实现起来复杂的两阶段提交序列。Vertical partitioning involves creating a table with fewer columns and splitting the columns across the table. Like federated databases, vertical partitioning requires middleware to determine how to route any request for a specific field to the appropriate partition. Additionally, these systems use a two-phase commit sequence that is complex to implement.
在被称为“无共享”架构的又一种手段中,每一个节点是独立的和自给的。无共享架构对于web发展是普及的,因为它可以简单通过以便宜的计算机的形式添加节点而向上扩展。该手段在数据仓库应用中是普及的,在数据仓库应用中,更新趋向于比事务处理出现得不频繁。然而,结合的处理在来自不同分区或机器的大数据集上很复杂。In another approach, known as a "shared-nothing" architecture, each node is independent and self-sufficient. Shared-nothing architecture is popular for web development because it can be scaled up simply by adding nodes in the form of inexpensive computers. This approach is also popular in data warehouse applications, where updates tend to occur less frequently than transactions. However, processing joins is complex when processing large data sets from different partitions or machines.
一些数据库系统被称为“分布式”系统。分布式系统的一种实现方式包含“簇”和两个通信路径。高速因特网路径在簇之间承载数据。诸如锁定管理的各种控制功能需要高速专用通信路径。虽然该手段解决了数据库的冗余和可用性问题,但是锁定管理如前所述可能限制系统性能。Some database systems are referred to as "distributed." One implementation of a distributed system consists of a "cluster" and two communication paths. A high-speed Internet path carries data between the clusters. Various control functions, such as lock management, require a high-speed, dedicated communication path. While this approach addresses database redundancy and availability, lock management, as previously mentioned, can limit system performance.
在“全共享”系统中,超高速的通信使系统保持同步。然而,锁定管理可能要求大量的带宽资源。为了避免这一点,这样的系统包含点到点的通信信道和很复杂的盘控制器。In a "shared-all" system, ultra-high-speed communication keeps the system synchronized. However, lock management can require a large amount of bandwidth resources. To avoid this, such systems include point-to-point communication channels and very complex disk controllers.
共同地,那些现有技术系统满足对于数据库系统的已知要求的一些而不是全部。所需的是一种数据库架构,其是可扩展的、满足ACID属性原子性、一致性、隔离性和持久性。也需要的是一种数据库系统,该数据库系统在因特网上操作而不需要专用高速通信路径,该数据库系统提供事务处理并且在大的地理区域上可操作。Collectively, those prior art systems meet some, but not all, of the known requirements for database systems. What is needed is a database architecture that is scalable, meets the ACID properties of atomicity, consistency, isolation, and durability. What is also needed is a database system that operates over the Internet without requiring dedicated high-speed communication paths, provides transaction processing, and is operable over a large geographic area.
发明内容Summary of the Invention
因此,本发明的一个目的是提供一种弹性的、可扩展的、按需的、分布式的数据处理系统。Therefore, an object of the present invention is to provide a flexible, scalable, on-demand, distributed data processing system.
本发明的另一个目的是提供一种弹性的、可扩展的、按需的、分布式的数据处理系统,该数据处理系统是容错的。Another object of the present invention is to provide a flexible, scalable, on-demand, distributed data processing system that is fault-tolerant.
本发明的又一个目的是提供一种弹性的、可扩展的、按需的、分布式的数据处理系统,该数据处理系统具有高度的可用性。Yet another object of the present invention is to provide a flexible, scalable, on-demand, distributed data processing system with high availability.
本发明的再一个目的是提供一种弹性的、可扩展的、按需的、分布式的数据处理系统,该数据处理系统是独立于平台的。Yet another object of the present invention is to provide a flexible, scalable, on-demand, distributed data processing system that is platform independent.
本发明的又一个目的是提供一种弹性的、可扩展的、按需的、分布式的数据处理系统,该数据处理系统是原子的、一致的、隔离的和持久的。Yet another object of the present invention is to provide a resilient, scalable, on-demand, distributed data processing system that is atomic, consistent, isolated, and durable.
本发明的又一个目的是提供一种弹性的、可扩展的、按需的、分布式的数据处理系统,该数据处理系统在因特网上操作而不需要专用的高速通信路径。It is a further object of the present invention to provide a flexible, scalable, on-demand, distributed data processing system that operates over the Internet without requiring dedicated high-speed communication paths.
本发明的再一个目的是提供一种弹性的、可扩展的、按需的、分布式的数据处理系统,该数据处理系统提供事务处理,并且适于在大的地理区域上实现。It is a further object of the present invention to provide a resilient, scalable, on-demand, distributed data processing system that provides transaction processing and is suitable for implementation over a large geographic area.
根据本发明的一个方面,一种使得用户能够与由数据和元数据构成的数据库交互的数据库管理系统,包括其间具有通信路径的多个节点和永久存储器。每一个节点包括在用户级处的高级输入和输出命令和在系统级处的输入和输出命令之间的接口,在系统级处的输入和输出命令控制用于与所述数据库交互的操作序列,其中,响应于特定的系统级命令,原子对象生成原子,每一个原子包含数据或元数据的指定片断,据此,原子的所有实例集集体地限定在所述数据库中的所有所述元数据和数据。每一个节点另外包括:用于在所述系统中与每一个节点建立通信路径的通信控制;响应于来自所述接口的系统命令而从选择的节点请求与查询相关但是不在那个节点中存在的原子的副本的方法;响应于来自另一个节点的对于原子的请求而复制请求的原子以传送到所述请求节点的方法,据此,仅完成查询所需的原子需要在任何给定的时间位于任何事务节点中;以及,响应于在那个节点处的原子中的改变而复制那个原子以传送到在那个原子所驻留的系统中的每一个其他节点的方法。所述永久存储器包含集体地包含在所述数据库中的所有所述数据和元数据的原子的集合。According to one aspect of the present invention, a database management system that enables users to interact with a database consisting of data and metadata includes a plurality of nodes and persistent storage with communication paths therebetween. Each node includes an interface between high-level input and output commands at the user level and input and output commands at the system level, the input and output commands at the system level controlling the sequence of operations used to interact with the database, wherein, in response to specific system-level commands, an atomic object generates atoms, each atom containing a specified fragment of data or metadata, whereby the set of all instances of atoms collectively defines all of the metadata and data in the database. Each node further includes: communication control for establishing a communication path with each node in the system; a method for requesting a copy of an atom that is relevant to a query but not present in that node from a selected node in response to a system command from the interface; a method for replicating the requested atom for transmission to the requesting node in response to a request for an atom from another node, whereby only the atoms required to complete the query need be present in any transaction node at any given time; and a method for replicating that atom in response to a change in the atom at that node for transmission to every other node in the system where the atom resides. The persistent storage contains a collection of atoms of all the data and metadata collectively contained in the database.
根据本发明的另一个方面,一种使得用户能够与由数据和元数据构成的数据库交互的数据库管理系统,所述系统包括向用户提供对于所述数据库的访问的至少一个事务节点和维持所述整个数据库的档案的至少一个档案节点。每一个事务节点包括数据库请求引擎,所述数据库请求引擎提供在用户级处的高级输入和输出查询命令和在系统级处的输入和输出命令之间的接口,在系统级处的输入和输出命令控制用于与所述数据库交互的操作序列,响应于特定的系统级命令,原子对象生成原子。每一个原子包含数据或元数据的指定片断,据此,原子的所有实例集集体地限定在所述数据库中的所有所述元数据和数据。数据库系统网络互连所有的所述节点。在所述节点的每一个中的通信控制在所述系统中与每一个节点建立通信路径。在每一个事务节点中的方法响应于来自所述数据库请求引擎的系统命令而请求与查询建立相关但是不存在于那个节点中的原子的副本。在每一个节点中的另一种方法响应于来自另一个节点的对于原子的请求而复制请求的原子以传送到所述请求节点,据此,仅完成查询命令所需的原子需要在任何给定的时间位于任何事务节点中。在每一个事务节点中的另一种方法响应于在那个节点处的原子中的改变而将那个改变复制到在包含那个节点的副本的系统中的每一个其他节点。According to another aspect of the present invention, a database management system enables users to interact with a database consisting of data and metadata. The system includes at least one transaction node that provides user access to the database and at least one archive node that maintains an archive of the entire database. Each transaction node includes a database request engine that provides an interface between high-level input and output query commands at the user level and input and output commands at the system level. The input and output commands at the system level control the sequence of operations used to interact with the database. In response to specific system-level commands, atomic objects generate atoms. Each atom contains a specified fragment of data or metadata, whereby the set of all instances of atoms collectively defines all metadata and data in the database. A database system network interconnects all of the nodes. Communication control in each of the nodes establishes a communication path with each node in the system. Methods in each transaction node, in response to system commands from the database request engine, request a copy of an atom that is relevant to the query but does not exist in that node. Another method in each node, in response to a request for atoms from another node, replicates the requested atoms for transmission to the requesting node, whereby only the atoms required to complete the query command need be located in any transaction node at any given time. Another method in each transaction node, in response to a change in an atom at that node, replicates that change to every other node in the system that contains a replica of that node.
根据本发明的又一个方面,一种用于逻辑数据库的数据库管理系统,所述逻辑数据库由数据记录构成,所述数据记录被组织为要从多个事务节点访问的表格,所述多个事务节点处理与所述逻辑数据库相关的事务,其中,所述数据库被解析为片断,其中,每一个片断存储与所述逻辑数据库相关的所述元数据和/或数据的一部分,以在所述数据库管理系统中作为串行消息传送,并且存储为非串行的消息。所述系统包括至少一个档案节点,所述档案节点在永久存储器中以非串行的形式存储所有的所述片断,由此构成用于所述整个数据库的单个储藏库。每一个事务节点通过建立用于识别与所述查询相关的片断的低级命令的序列来响应于来自用户的查询,并且通过获得与在其被处理的所述查询相关的现有片断的那些副本来响应于所述低级命令,据此,给定的片断可能位于某个其他节点处或仅位于档案节点处。每一个事务节点向所述至少一个档案节点和任何改变的片断的副本所驻留的每一个事务节点复制那个片断,据此,在对等的基础上对于在其他节点中的片断进行改变,并且据此,任何事务节点仅包含与通过那个事务节点访问所述数据库的用户作出的查询相关的那些片断。According to another aspect of the present invention, a database management system for a logical database comprises data records organized into tables to be accessed from a plurality of transaction nodes, the plurality of transaction nodes processing transactions associated with the logical database. The database is parsed into fragments, each fragment storing a portion of the metadata and/or data associated with the logical database for transmission as serialized messages within the database management system and stored as non-serialized messages. The system includes at least one archive node storing all of the fragments in non-serialized form in persistent storage, thereby forming a single repository for the entire database. Each transaction node responds to queries from a user by establishing a sequence of low-level commands for identifying the fragments associated with the query, and responds to the low-level commands by obtaining copies of existing fragments associated with the query being processed, whereby a given fragment may be located at some other node or only at the archive node. Each transaction node replicates any changed fragment to the at least one archive node and to each transaction node where a copy of that fragment resides, whereby changes to fragments in other nodes are made on a peer-to-peer basis, and whereby any transaction node contains only those fragments that are relevant to queries made by users accessing the database through that transaction node.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
所附的权利要求特别指出和清楚地要求保护本发明的主题。通过结合附图阅读下面的详细说明,本发明的各个目的、优点和新颖特征将更充分清楚,在附图中,相似的附图标号指示相似的部分,并且在附图中:The subject matter of the invention is particularly pointed out and distinctly claimed in the appended claims. Various objects, advantages and novel features of the invention will become more fully apparent from the following detailed description when read in conjunction with the accompanying drawings in which like reference numerals indicate like parts, and in which:
图1是弹性的、可扩展的、按需的、分布式的数据处理系统的一个实施例的示意形式的图,该数据处理系统包含具有互连的事务和档案节点的本发明;FIG1 is a diagram in schematic form of one embodiment of a resilient, scalable, on-demand, distributed data processing system incorporating the present invention having interconnected transaction and archival nodes;
图2描述了事务节点的组织;Figure 2 describes the organization of transaction nodes;
图3描述了档案节点的组织;Figure 3 describes the organization of archive nodes;
图4A和4B描述了由在图2和3中所示的原子类生成的“原子”对象的逻辑组织,所述“原子”对象对实现本发明有用,并且它们可能在任何给定时间出现在事务节点中;4A and 4B depict the logical organization of “atomic” objects generated by the atomic classes shown in FIGs. 2 and 3 , which are useful in implementing the present invention and which may appear in a transaction node at any given time;
图5描述了在主目录原子中的信息;Figure 5 describes the information in the main directory atom;
图6描述了在事务管理器原子中的信息;Figure 6 describes the information in the transaction manager atom;
图7描述了在数据库原子中的信息;Figure 7 describes the information in the database atom;
图8描述了在图式原子中的信息;Figure 8 describes the information in the schema atom;
图9描述了在表格原子中的信息;Figure 9 describes the information in the table atom;
图10描述了在表格目录原子中的信息;Figure 10 describes the information in the table directory atom;
图11描述了在索引原子中的信息;Figure 11 describes the information in the index atom;
图12描述了在记录状态原子中的信息;Figure 12 describes the information in the record state atom;
图13描述了在数据原子中的信息;Figure 13 describes the information in the data atom;
图14描述了在大二进制对象(Blob)状态原子中的信息;FIG14 depicts the information in a large binary object (Blob) state atom;
图15描述了在大二进制对象原子中的信息;Figure 15 describes the information in a large binary object atom;
图16描述了在图1的数据库系统的事务和档案节点之间传送的示例性异步消息的句法;FIG16 depicts the syntax of exemplary asynchronous messages transmitted between transactions and archive nodes in the database system of FIG1 ;
图17描述了通过其在图1的数据库系统的事务和档案节点之间传送信息的各种消息类型;FIG17 depicts various message types by which information is transferred between transaction and archive nodes in the database system of FIG1 ;
图18是对理解通过其节点加入在图1中的数据库系统的方法有用的流程图;FIG18 is a flowchart useful for understanding the method by which nodes are joined to the database system in FIG1 ;
图19描述了在节点对象中的信息;Figure 19 describes the information in a node object;
图20是根据本发明的、对理解通过其节点创建原子的方法有用的流程图;FIG20 is a flowchart useful for understanding a method for creating atoms through their nodes according to the present invention;
图21是对理解通过其在图20的方法期间分配唯一的原子标识的方法有用的流程图;FIG. 21 is a flowchart useful in understanding the method by which unique atom identifiers are assigned during the method of FIG. 20 ;
图22是对理解通过其一个节点从另一个节点获得原子的副本的方法有用的流程图;以及FIG. 22 is a flowchart useful in understanding a method by which one node obtains a copy of an atom from another node; and
图23是对理解通过其本发明提交事务的方法有用的流程图。FIG. 23 is a flow chart useful in understanding the method by which the present invention commits a transaction.
具体实施方式DETAILED DESCRIPTION
图1描述了弹性的、可扩展的、按需的、分布式的数据库系统30的一个实施例,该系统具有包含本发明的多个数据处理节点。节点N1至N6是“事务节点”,它们向数据库提供用户应用访问;节点A1和A2是“档案节点”,它们用于在每一个档案节点处维持整个数据库的盘档案。虽然档案节点通常存储整个数据库,但是单个事务节点仅包含确定支持在那时在那个节点执行的事务所需的数据库的那个部分。FIG1 illustrates one embodiment of a resilient, scalable, on-demand, distributed database system 30 having multiple data processing nodes incorporating the present invention. Nodes N1 through N6 are "transaction nodes" that provide user application access to the database; nodes A1 and A2 are "archive nodes" that maintain a disk archive of the entire database at each archive node. While archive nodes typically store the entire database, a single transaction node contains only the portion of the database required to support the transactions executing at that node at that time.
在图1中的每一个节点可以通过数据库系统网络31与在系统中的其他节点直接地进行通信。例如,节点N1可以与节点N2至N6、A1和A2中的每一个建立通信路径。在任何两个节点之间的通信是借助于串行化的消息。在一个优选实施例中,以异步的方式来执行消息传送,以最大化由系统使用的带宽,由此以及时和迅速的方式来执行各种操作。通常,数据库系统网络31将用高带宽的、低延迟路径(例如,以太网)和高带宽的、高延迟的路径(例如,广域网)的组合来操作。每一个节点具有用于将低延迟的路径的使用限制到时间关键的通信(例如,获取原子)的能力。高延迟路径可以用于不关键的通信(例如,请求更新表格的信息)。而且且优选的是,本发明的数据处理网络包含诸如传输控制协议(TCP)的消息传送协议,并且保证每一个节点以消息被其他节点发送到该每一个节点的相同顺序来处理消息。Each node in Figure 1 can communicate directly with other nodes in the system through the database system network 31. For example, node N1 can establish a communication path with each of nodes N2 to N6, A1 and A2. Communication between any two nodes is by means of serialized messages. In a preferred embodiment, message transmission is performed in an asynchronous manner to maximize the bandwidth used by the system, thereby performing various operations in a timely and rapid manner. Typically, the database system network 31 will operate with a combination of high-bandwidth, low-latency paths (e.g., Ethernet) and high-bandwidth, high-latency paths (e.g., wide area networks). Each node has the ability to limit the use of low-latency paths to time-critical communications (e.g., obtaining atoms). High-latency paths can be used for non-critical communications (e.g., requesting to update table information). Moreover, and preferably, the data processing network of the present invention includes a message transmission protocol such as the Transmission Control Protocol (TCP) and ensures that each node processes messages in the same order in which they are sent to each node by other nodes.
图2描述了代表性的事务节点32,该代表性的事务节点32链接到数据库系统网络31和各个最终用户33。事务节点32包括中央处理系统(CP)34,CP 34通过网络接口35与数据库系统网络31进行通信,并且通过用户网络接口37与各个用户进行通信。中央处理系统34也与RAM存储器38交互,RAM存储器38包含实现本发明的优选实施例的数据流管理程序的副本。该程序用于提供远程接口40、数据库请求引擎41和类和对象的集42。FIG2 depicts a representative transaction node 32 connected to a database system network 31 and various end users 33. Transaction node 32 includes a central processing system (CP) 34 that communicates with database system network 31 via a network interface 35 and with various users via a user network interface 37. Central processing system 34 also interacts with RAM memory 38, which contains a copy of a data flow management program that implements a preferred embodiment of the present invention. This program is used to provide a remote interface 40, a database request engine 41, and a set of classes and objects 42.
数据库请求引擎41仅位于事务节点上,并且是在用户级的高级输入和输出命令和在系统级的系统级输入和输出命令之间的接口。一般而言,其数据库请求引擎将诸如SQL查询的用户查询解析、编译和优化为被在集42中的各个类或对象解译的命令。The database request engine 41 is located only on the transaction node and is the interface between the high-level input and output commands at the user level and the system-level input and output commands at the system level. Generally speaking, its database request engine parses, compiles, and optimizes user queries such as SQL queries into commands that are interpreted by the various classes or objects in the set 42.
为了解释本发明的目的,所设定的类/对象集42被划分为“原子类”的子集43、“消息类”的子集44和“助手类”的子集45。下面描述这些类的另外的细节。For purposes of explaining the present invention, the set of classes/objects 42 is divided into a subset of "atomic classes" 43, a subset of "message classes" 44, and a subset of "helper classes" 45. Additional details of these classes are described below.
如将变得显然且根据本发明,在任何给定的时间,事务节点仅包含与活动的用户应用相关的总的数据库的那些部分。而且,本发明的各个特征使得在使用中的数据库的所有部分能够驻留在随机存取存储器38中。不必在这个系统的操作期间在事务节点处提供补充的存储器,诸如盘存储器。As will become apparent and in accordance with the present invention, at any given time, a transaction node contains only those portions of the total database that are relevant to active user applications. Furthermore, the various features of the present invention enable all portions of the database in use to reside in random access memory 38. It is not necessary to provide supplemental storage, such as disk storage, at the transaction nodes during operation of this system.
参见图3,诸如在图1中的档案节点A1或A2的每一个档案节点50也连接到数据库系统网络31。然而,取代与在图2中的事务节点32相关联的最终用户33,档案节点仅连接到永久存储器51,该永久存储器51通常是基于盘的存储系统或键值储藏库。档案节点50包括中央处理系统54,中央处理系统54通过I/O信道52与永久存储器51进行通信,并且通过网络接口55与数据库系统网络31进行通信。中央处理系统54也与RAM存储器57交互,RAM存储器57包含类或对象的集62。与在图2中的事务节点32类似地,在图3中的类/对象集62包括“原子类”的集63、“消息类”的集64和“助手类”的集65。Referring to FIG3 , each archive node 50, such as archive node A1 or A2 in FIG1 , is also connected to a database system network 31. However, instead of end users 33 associated with transaction nodes 32 in FIG2 , the archive nodes are connected only to persistent storage 51, which is typically a disk-based storage system or a key-value store. Archive nodes 50 include a central processing system 54, which communicates with persistent storage 51 via I/O channels 52 and with database system network 31 via network interface 55. Central processing system 54 also interacts with RAM memory 57, which contains a set of classes or objects 62. Similar to transaction nodes 32 in FIG2 , the class/object set 62 in FIG3 includes a set 63 of "atomic classes," a set 64 of "message classes," and a set 65 of "helper classes."
本发明的一个优选实施例使用面向对象的编程(OOP),其中,如本领域中已知,例如在图2和3中所示的类和子类限定了方法、数据结构和进程,通过它们,可以生成那个类或子类的“实例”或对象。可以使用“继承”和/或“多态变形”来生成“实例”。对于本领域内的技术人员将变得显然,在具体公开的实施例中不使用面向对象的编程或变化形式的实现方式是可能的。A preferred embodiment of the present invention uses object-oriented programming (OOP), in which, as is known in the art, classes and subclasses, such as those shown in Figures 2 and 3, define methods, data structures, and processes by which "instances" or objects of that class or subclass can be generated. "Inheritance" and/or "polymorphism" can be used to generate "instances." It will become apparent to those skilled in the art that implementations that do not use object-oriented programming or variations of the specifically disclosed embodiments are possible.
现在将以几个阶段来描述本发明。“原子”部分限定了分别由在图2和3中的原子类43和63产生的对象的等级和功能。“消息”部分描述了消息集,该消息集在可能分别被在图2和3中的消息类44和64产生的事务和档案节点之间提供通信。“方法”部分描述了相对于数据库管理的基本操作。“示例”部分描述了原子、消息和方法的交互,由此响应于对于数据库请求引擎41的特定数据库查询而实现本发明的目标。The present invention will now be described in several stages. The "Atoms" section defines the hierarchy and functionality of objects generated by the Atom classes 43 and 63 in Figures 2 and 3, respectively. The "Messages" section describes the message set that provides communication between transactions and archive nodes that may be generated by the message classes 44 and 64 in Figures 2 and 3, respectively. The "Methods" section describes the basic operations with respect to database management. The "Examples" section describes the interaction of atoms, messages, and methods, thereby achieving the objectives of the present invention in response to a specific database query to the database request engine 41.
原子atom
如前所述,在图2中的原子类43和在图3中的63的每一个产生“原子”。更具体地,原子类限定了一个或多个“原子类型”或“原子对象”。每个“原子类型”或“原子对象”产生其本身,也就是“原子”的“实例”。如在更详细地理解每个特定原子对象的目的的情况下将变得清楚的,每一个“原子”包含数据库信息的特定片断。一些原子包含数据库元数据的一部分;其他包含数据记录;其他用作创建和跟踪其他原子类型的目录。一些“原子类型”可以仅例示复制到所有节点的一个原子。其他“原子类型”可以例示在按需的基础上被复制到其他节点的多个原子。As previously mentioned, each of the atomic classes 43 in Figure 2 and 63 in Figure 3 produces an "atom". More specifically, an atomic class defines one or more "atom types" or "atom objects". Each "atom type" or "atom object" produces itself, an "instance" of an "atom". As will become clear when the purpose of each particular atomic object is understood in more detail, each "atom" contains a specific piece of database information. Some atoms contain part of the database metadata; others contain data records; and others serve as directories for creating and tracking other atomic types. Some "atom types" may instantiate only one atom that is replicated to all nodes. Other "atom types" may instantiate multiple atoms that are replicated to other nodes on an on-demand basis.
原子具有特定的特性。在事务节点中,原子仅存在于非永久存储器中,并且具有非串行消息的形式,该非串行消息已经填充了特定的原子类型以提供用于该原子的有效存储器驻留格式。每一个原子具有用于将其内容编码为串行消息的装置和用于将串行消息解码以检索原子的内容的装置。结合如后面将描述的多个操作,使用这样的串行消息。Atoms have specific characteristics. In a transaction node, atoms exist only in non-persistent memory and take the form of non-serial messages that have been populated with a specific atom type to provide an efficient memory-resident format for that atom. Each atom has a means for encoding its contents as a serial message and a means for decoding the serial message to retrieve the atom's contents. Such serial messages are used in conjunction with a number of operations, as will be described later.
从用于复制原子的节点发送的每一个串行消息包括具有附加的节点标识的那个原子的内容和用于那个节点的最近的事务提交序列号。当档案节点接收到那个串行消息时,它在将消息(即,原子)的剩余内容置于永久存储器中之前将该消息去串行化,去除节点列表和提交序列号。Each serial message sent from a node replicating an atom includes the contents of that atom with the node identifier appended and the most recent transaction commit sequence number for that node. When the archive node receives that serial message, it deserializes the message (i.e., atom) before placing the remaining contents in permanent storage, removing the node list and commit sequence number.
多个规则适用于根据本发明的原子。那些规则的原因和暗示将变得更清楚。首先,每一个原子必须具有唯一标识,以在图1中的数据库处理网络30中的任何位置提供那个原子的可靠标识。其次,任何原子必须同时存在于两个节点中以维持冗余,除了单个原子在创建单个原子后并且在档案节点已经请求副本之前可以存在。第三,事务节点将仅按需来安装原子。第四,每次对于在一个节点中的原子进行改变时,那个节点必须在“对等”的基础上复制那个改变的原子;即,向所有的档案节点和仅包含那同一原子的那些事务节点复制那个改变的原子。A number of rules apply to atoms according to the present invention. The reasons and implications of those rules will become clearer. First, each atom must have a unique identifier to provide reliable identification of that atom anywhere in the database processing network 30 in Figure 1. Second, any atom must exist in two nodes at the same time to maintain redundancy, except that a single atom can exist after the single atom is created and before the archive node has requested a copy. Third, transaction nodes will only install atoms on demand. Fourth, each time a change is made to an atom in a node, that node must replicate that changed atom on a "peer" basis; that is, replicate that changed atom to all archive nodes and only those transaction nodes that contain that same atom.
可以在档案和事务节点上出现下面更详细地描述的“垃圾收集”处理。该处理从事务和档案节点去除不活动的原子,结果,事务节点可以在那个节点处的随机存取存储器中存储当前与用户应用相关的那些原子。因此,数据库请求引擎41将整个数据库“看作”局部的,并且不知道它在多节点环境中操作,并且没有在其节点处的数据库的完整副本。档案节点具有在原子已经被串行化到盘后清除原子的内容的选项,由此减小存储所需的存储器的大小。如果档案节点从这样的原子接收复制消息,则档案节点必须从盘存储器获取内容,然后应用被复制的来自原子的信息。A "garbage collection" process, described in more detail below, may occur on archive and transaction nodes. This process removes inactive atoms from transaction and archive nodes, with the result that a transaction node may store those atoms that are currently relevant to the user application in random access memory at that node. Thus, the database request engine 41 "sees" the entire database as local and is unaware that it is operating in a multi-node environment and does not have a complete copy of the database at its node. Archive nodes have the option of clearing the contents of an atom after it has been serialized to disk, thereby reducing the size of the memory required for storage. If an archive node receives a replication message from such an atom, the archive node must obtain the content from disk memory and then apply the replicated information from the atom.
在该一般背景下,现在将在“逻辑”或功能级上描述每一个原子类型。该信息与本发明的操作的进一步的讨论相结合地将使得本领域内的普通技术人员能够以多种实现方式的任何一种来制造和使用本发明,所述实现方式包括基于面向对象的编程的实现方式。Against this general background, each atom type will now be described at a "logical" or functional level. This information, combined with a further discussion of the operation of the invention, will enable one of ordinary skill in the art to make and use the invention in any of a variety of implementations, including implementations based on object-oriented programming.
图4A和4B描述了数据库引擎41和在任何给定时间可以驻留在事务节点32中的典型的原子集。在该示例中,事务节点托管主目录原子70、事务管理器原子71、数据库原子72、图式原子73、表格原子74和表格目录原子75。每一个数据库仅有一个主目录原子70、一个事务管理器原子71和一个数据库原子72。当数据库请求引擎41创建新的数据库时,创建事务管理器原子71、数据库原子72和图式原子73。4A and 4B illustrate a typical set of atoms that may reside in a transaction node 32 and the database engine 41 at any given time. In this example, the transaction node hosts a master directory atom 70, a transaction manager atom 71, a database atom 72, a schema atom 73, a table atom 74, and a table directory atom 75. Each database has only one master directory atom 70, one transaction manager atom 71, and one database atom 72. When a database requests that the engine 41 create a new database, the transaction manager atom 71, the database atom 72, and the schema atom 73 are created.
参见图4A,主目录原子70跟踪在图1的数据库系统30中的事务和档案节点的状态。它也可以被看作活动索引,该活动索引创建和监视事务管理器原子71、数据库原子72、每一个图式原子73、每一个对应的集的表格原子74和表格目录原子75与序列ID管理器82。4A , the master directory atom 70 tracks the state of transactions and archive nodes in the database system 30 of FIG 1. It can also be viewed as an active index that creates and monitors the transaction manager atom 71, the database atom 72, each schema atom 73, each corresponding set of table atoms 74, and the table directory atom 75 along with the sequence ID manager 82.
表格目录原子75充当活动索引,并且创建和监视与单个表格相关联的索引原子76、记录状态原子77、数据原子78、大二进制对象状态原子80和大二进制对象原子81。也就是,每一个表格有一个表格目录原子75。The table directory atom 75 acts as an active index and creates and monitors the index atom 76, record status atom 77, data atom 78, large blob status atom 80, and large blob atom 81 associated with a single table. That is, there is one table directory atom 75 for each table.
图4B对理解不同的原子类型的交互和管理有用。在该上下文中,主目录原子70和表格目录原子75都不执行任何管理功能。相对于剩余的原子,主目录原子70管理每一个图式原子73。每一个图式原子73管理每一个相关的表格原子74和序列ID管理器82。每一个表格原子74管理其对应的表格目录原子75、索引原子76、记录状态原子77、数据原子78、大二进制对象状态原子80和大二进制对象原子81。Figure 4B is useful for understanding the interaction and management of different atom types. In this context, neither the master directory atom 70 nor the table directory atom 75 performs any management functions. Relative to the remaining atoms, the master directory atom 70 manages each schema atom 73. Each schema atom 73 manages each associated table atom 74 and sequence ID manager 82. Each table atom 74 manages its corresponding table directory atom 75, index atom 76, record status atom 77, data atom 78, large binary object status atom 80, and large binary object atom 81.
仍然参见图4B,数据库请求引擎41与主目录原子70、事务管理器原子71、数据库原子72、每一个图式原子73、每一个表格原子74和序列ID管理器82进行通信。数据库请求引擎41充当用于诸如SQL的高级语言的编译器。作为编译器,它解析、编译和优化查询,并且从原子获得元数据和数据以形成数据库信息的各个片断。Still referring to FIG4B , the database request engine 41 communicates with the master catalog atom 70, the transaction manager atom 71, the database atom 72, each schema atom 73, each table atom 74, and the sequence ID manager 82. The database request engine 41 acts as a compiler for a high-level language such as SQL. As a compiler, it parses, compiles, and optimizes queries, and obtains metadata and data from atoms to form various pieces of database information.
每一个原子具有特定的公共元素和对于其类型特定的其他元素。参见图5,主目录原子70包括公共元素70A至70I。元素70A是原子的唯一标识。因为仅存在向所有节点复制的主目录原子的一个实例,所以主目录原子ID 70A被给出固定编号,通常为“1”。作为一般规则,指针70B和70C分别识别主目录原子和创建目录原子。对于主目录原子,两个指针识别主目录原子本身。Each atom has certain common elements and other elements specific to its type. Referring to Figure 5, a master directory atom 70 includes common elements 70A to 70I. Element 70A is the unique identifier of the atom. Because there is only one instance of the master directory atom that is replicated to all nodes, the master directory atom ID 70A is given a fixed number, usually "1". As a general rule, pointers 70B and 70C identify the master directory atom and the create directory atom, respectively. For the master directory atom, two pointers identify the master directory atom itself.
每个原子必须具有主席。主席执行如下所述的功能。元素70D是指向其中那个原子的主席所驻留的那个节点的指针。Each atom must have a chairperson. The chairperson performs the functions described below. Element 70D is a pointer to the node where the chairperson for that atom resides.
每次在任何事务节点改变原子的副本时,它接收新的改变编号。元素70E记录那个改变编号。Each time a copy of an atom is changed at any transaction node, it receives a new change number. Element 70E records that change number.
每当一个节点从另一个节点请求原子时,存在间隔,在该时间间隔期间,请求的节点将不被其他事务节点知道。元素70F是所有节点的列表,对于该所有节点,供应节点必须向请求的节点中继来自包含那个原子的所有其他节点的消息,直到完成了请求。Whenever a node requests an atom from another node, there is an interval during which the requesting node will not be known to other transaction nodes. Element 70F is a list of all nodes for which the supplying node must relay messages from all other nodes containing that atom to the requesting node until the request is fulfilled.
数据库系统的操作也被划分为循环。循环参考元素70G提供对原子的最后访问的循环数。元素70H是包含该原子的所有活动节点的列表。元素70I包括几个状态指示符。The operations of the database system are also divided into cycles. Cycle reference element 70G provides the cycle number of the last access to the atom. Element 70H is a list of all active nodes containing the atom. Element 70I includes several status indicators.
仍然参见图5,全局节点IDS条目70J包含ID管理器,用于对于在系统中的每一个活动节点分配唯一的标识符。如所知,这样的标识符是长的字符串。局部节点IDS条目70K包括多达可以附到系统的节点的总数的数的范围。这些条目一起提供了在两种类型的标识之间的对应性。局部节点IDS的使用提高了效率。Still referring to FIG5 , the global node IDS entry 70J contains an ID manager for assigning a unique identifier to each active node in the system. As is known, such identifiers are long strings. The local node IDS entry 70K includes a range of numbers up to the total number of nodes that can be attached to the system. Together, these entries provide a correspondence between the two types of identification. The use of local node IDS improves efficiency.
当事务节点加入在图1中的数据库系统30时,连接管理器70L实行那个处理。下面描述用于使得事务节点能够加入数据库系统的特定实现方式。加入节点使用待决节点状态条目70M来指示它没有用于响应节点的全局地址,直到它从那个响应节点接收到进一步的通信。数据库UUI条目70N包含数据库的通用唯一标识。When a transaction node joins the database system 30 in FIG1 , the connection manager 70L performs that process. A specific implementation for enabling a transaction node to join the database system is described below. The joining node uses the pending node status entry 70M to indicate that it does not have a global address for a responding node until it receives further communication from that responding node. The database UUI entry 70N contains the universally unique identifier of the database.
在70P处的条目是重要的,因为它们链接所有的原子,对于该所有的原子,主目录原子70充当活动索引。如前所述,这些包括数据库原子72与图式原子73、表格原子74和表格目录原子75中的每一个。The entries at 70P are important because they link all atoms for which the master directory atom 70 acts as an active index. As previously described, these include the database atom 72 and each of the schema atom 73, table atom 74, and table directory atom 75.
密码条目70Q表示用于认证向数据库内的连接的装置。实际和软件版本条目70R和70S允许系统当安装软件的较新版本时以反向兼容来操作。实际软件条目70R识别当时在使用中的软件版本;软件版本条目70S,与最近安装的版本相对应的数。这允许各个节点被更新到较新的版本,而不需要更新其他节点,并且不关闭由所有节点访问的数据库。Password entry 70Q represents the means for authenticating connections into the database. Actual and Software Version entries 70R and 70S allow the system to operate with backward compatibility when newer versions of the software are installed. Actual Software entry 70R identifies the software version currently in use; Software Version entry 70S is the number corresponding to the most recently installed version. This allows individual nodes to be updated to newer versions without requiring updates to other nodes and without shutting down the database accessed by all nodes.
仍然参见图5,主目录原子70也包括指向事务管理器原子71的指针70T、指向配置对象的指针70U、指向垃圾收集线程的指针70V和指向ping线程的指针70W。ping线程定期地并且独立于在节点处的其他操作进行操作。它“ping”每一个节点,以提供可以在对应的路径的通信效率的确定中使用的信息。例如,如果在图1中的节点N1具有与节点N2或N5进行通信的选项,则节点N1可以在用于那个通信的到节点N2和N5的通信路径的最有效的选择中使用ping信息。也可以替代或添加其他选择处理。Still referring to FIG5 , the master directory atom 70 also includes a pointer 70T to the transaction manager atom 71, a pointer 70U to the configuration object, a pointer 70V to the garbage collection thread, and a pointer 70W to the ping thread. The ping thread operates periodically and independently of other operations at the node. It "pings" each node to provide information that can be used in determining the communication efficiency of the corresponding path. For example, if node N1 in FIG1 has the option of communicating with node N2 or N5, node N1 can use the ping information in the most efficient selection of the communication path to nodes N2 and N5 for that communication. Other selection processes can also be replaced or added.
参见图6,对于每一个数据库存在一个事务管理器原子71,并且在创建主目录原子70的同一处理期间创建它。事务管理器原子71响应于来自数据库请求引擎41的数据库命令来创建、跟踪和结束数据库事务。事务管理器原子71包括与在主目录原子中的相似元素对应的元素71A-71I。然而,元素71A是事务管理器原子71的标识。元素71B和71C都指向主目录原子70。6 , a transaction manager atom 71 exists for each database and is created during the same process as the master directory atom 70. The transaction manager atom 71 creates, tracks, and ends database transactions in response to database commands from the database request engine 41. The transaction manager atom 71 includes elements 71A-71I corresponding to similar elements in the master directory atom. However, element 71A is the identifier of the transaction manager atom 71. Elements 71B and 71C both point to the master directory atom 70.
ID管理器71J提供了唯一的事务序列标识,并且维持活动事务列表71K、提交的事务列表71L和失败的事务列表71M。元素71N存储提交序列信息。ID管理器71J在每一个事务的开始处分配事务ID。每一个事务ID是唯一的,但是不必要的依序的。局部事务管理器原子当事务提交时向元素71N分配提交序列号。序列号是依序的,并且每一个特定于请求事务的节点。事务过渡事件计数器71P识别在每一个事务期间出现的离散事件,诸如事务的开始和事务的成功提交。这样的计数器当涉及同一信息的多个事务重叠时是有用的。The ID manager 71J provides unique transaction sequence identification and maintains a list of active transactions 71K, a list of committed transactions 71L, and a list of failed transactions 71M. Element 71N stores commit sequence information. The ID manager 71J assigns a transaction ID at the beginning of each transaction. Each transaction ID is unique, but not necessarily sequential. The local transaction manager atomically assigns a commit sequence number to element 71N when a transaction commits. The sequence numbers are sequential and each is specific to the node requesting the transaction. A transaction transition event counter 71P identifies discrete events that occur during each transaction, such as the start of a transaction and the successful commit of a transaction. Such a counter is useful when multiple transactions involving the same information overlap.
参见图7,在创建主目录原子70和事务管理器原子71的同时创建数据库原子72。数据库原子72识别图式原子73中的每一个。数据库原子72可以涉及当新的用户试图加入数据库时的认证处理。它也可以包括关于授权级的其他数据。7 , a database atom 72 is created at the same time as the master directory atom 70 and the transaction manager atom 71. The database atom 72 identifies each of the schema atoms 73. The database atom 72 may be involved in the authentication process when a new user attempts to join the database. It may also include other data regarding the authorization level.
一般,数据库原子72包括与在图5中的类似元素相对应的元素72A-72I。元素72A是数据库原子标识。指针72B和72C中的每个识别主目录原子70。图式名称-图式ID注册表72J将图式名称与图式原子标识相关。In general, database atom 72 includes elements 72A-72I corresponding to similar elements in Figure 5. Element 72A is a database atom identifier. Pointers 72B and 72C each identify a master directory atom 70. Schema name-schema ID registry 72J associates schema names with schema atom identifiers.
参见图8,图式原子73创建和跟踪用于那个图式的表格原子。数据库原子72可以管理多个图式原子,并且每一个图式原子可以与多个表格原子交互。图式原子73包括与在图5中的元素70A-70I相对应的元素73A-73I。元素73A是唯一图式原子标识73A,并且元素73B和73C是指向主目录原子70的指针。表格在图式中具有唯一名称。表格名称-表格原子ID注册表73J提供了在每一个表格名称和对应的表格原子之间的对应性。每一个图式序列具有名称。序列名称-序列ID管理器注册表73K提供了在那些名称和诸如在图4A和4B中的序列ID管理器82的、与每一个图式原子相关联的对应的序列ID管理器之间的关系。Referring to Figure 8, a schema atom 73 creates and tracks table atoms for that schema. The database atom 72 can manage multiple schema atoms, and each schema atom can interact with multiple table atoms. The schema atom 73 includes elements 73A-73I corresponding to elements 70A-70I in Figure 5. Element 73A is a unique schema atom identifier 73A, and elements 73B and 73C are pointers to the master directory atom 70. Tables have unique names in a schema. The table name-table atom ID registry 73J provides a correspondence between each table name and the corresponding table atom. Each schema sequence has a name. The sequence name-sequence ID manager registry 73K provides a relationship between those names and the corresponding sequence ID manager, such as the sequence ID manager 82 in Figures 4A and 4B, associated with each schema atom.
图9提供了包含与字段、格式、索引和类型相关的元数据并且管理那个表格的索引原子76、记录状态原子77和大二进制对象状态原子80中的每一个的表格原子74的逻辑视图。它也创建和跟踪在表格内的数据。表格原子74包括与在图5中的元素70A-70I相对应的元素74A-74I。元素74A包括唯一表格原子标识、元素74B和74C两者指向主目录原子。指针74J识别对应的表格目录原子。元素74K包含表格的所有字段的列表。FIG9 provides a logical view of a table atom 74 that contains metadata related to fields, formats, indexes, and types and manages each of the index atom 76, record status atom 77, and large binary object status atom 80 of that table. It also creates and tracks data within the table. The table atom 74 includes elements 74A-74I corresponding to elements 70A-70I in FIG5 . Element 74A includes a unique table atom identifier, and elements 74B and 74C both point to the main directory atom. Pointer 74J identifies the corresponding table directory atom. Element 74K includes a list of all fields of the table.
每一个表格原子具有几个ID管理器。指针74L指向ID管理器,该管理器向每个字段提供了唯一的标识。指针74M、74N、74P和74Q识别用于分别向索引原子、数据原子、大二进制对象原子和子类型分配标识的独立的ID管理器。元素74R是现有子类型的列表。阵列74S和74T分别提供了记录状态原子和大二进制对象状态的位置。Each table atom has several ID managers. Pointer 74L points to the ID manager, which provides a unique identifier for each field. Pointers 74M, 74N, 74P, and 74Q identify independent ID managers for assigning identifiers to index atoms, data atoms, large binary object atoms, and subtypes, respectively. Element 74R is a list of existing subtypes. Arrays 74S and 74T provide locations for recording status atoms and large binary object status, respectively.
现在参见图10,对于每一个表格原子有一个表格目录原子。当创建表格原子时创建每一个表格目录原子75。继而,表格目录原子创建和跟踪特定于包括索引、记录状态、数据、大二进制对象状态和大二进制对象原子的一个表格的原子。每一个表格目录原子75包括与在图6中的元素70A-70I对应的元素75A-75I。元素75A是如由主目录原子分配的唯一表格目录原子标识。两个元素75B和75C指向主目录原子70。ID管理器75J提供用于索引、记录状态、数据、大二进制对象状态和大二进制对象原子中的每一个的唯一原子标识。列表75K识别与对应的表格原子相关联的所有原子。在元素75L中的指针识别与对应的表格原子相关联的局部节点处的每一个原子的位置。一系列列表75M对于每一个原子识别具有那个原子的复制的节点的列表。位图75N提供了用于当原子在档案节点中时识别其他对象和目录的方便手段。Referring now to FIG. 10 , there is a table directory atom for each table atom. Each table directory atom 75 is created when the table atom is created. The table directory atom then creates and tracks atoms specific to a table including index, record status, data, large binary object status, and large binary object atoms. Each table directory atom 75 includes elements 75A-75I corresponding to elements 70A-70I in FIG. 6 . Element 75A is a unique table directory atom identifier as assigned by the master directory atom. Two elements 75B and 75C point to the master directory atom 70. An ID manager 75J provides unique atom identifiers for each of the index, record status, data, large binary object status, and large binary object atoms. A list 75K identifies all atoms associated with the corresponding table atom. A pointer in element 75L identifies the location of each atom at the local node associated with the corresponding table atom. A series of lists 75M identify, for each atom, a list of nodes that have a copy of that atom. A bitmap 75N provides a convenient means for identifying other objects and directories when atoms are in an archive node.
参见图11,在表格中的每一个索引有一个索引原子76,并且每个表格可以有多个索引原子。每一个索引原子包括分别与在图5中的元素70A-70I对应的元素76A-76I。元素76A是如由对应的表格目录原子分配的唯一索引原子标识。指针76B和76C分别识别主目录原子和表格目录原子。元素76J包含索引节点的二进制树,以提供传统的索引化功能。元素76K包含索引级。这样的索引结构和操作是本领域内的技术人员已知的。Referring to Figure 11, each index in the table has an index atom 76, and each table can have multiple index atoms. Each index atom includes elements 76A-76I corresponding to elements 70A-70I in Figure 5 respectively. Element 76A is a unique index atom identifier as assigned by the corresponding table directory atom. Pointers 76B and 76C identify the main directory atom and the table directory atom respectively. Element 76J contains a binary tree of index nodes to provide traditional indexing functions. Element 76K contains index levels. Such index structures and operations are known to those skilled in the art.
返回图12,记录状态原子77管理用于在单个表格内的固定范围的记录编号的记录版本和状态。因此,给定的表格原子可以管理多个记录状态原子。每一个记录状态原子包括与在图5中的元素70A-70I对应的元素77A-77I。元素77A包括创建表格目录原子分配的记录状态原子ID。指针77B和77C分别识别主目录和表格目录原子。元素77J是用于定位由记录状态原子77管理的所有数据原子的阵列。元素77K包含用于“基本记录”的记录编号。也就是,每一个数据原子存储多个记录。元素77是指向对应的表格原子的指针。Returning to Figure 12, the record status atom 77 manages the record versions and status for a fixed range of record numbers within a single table. Therefore, a given table atom can manage multiple record status atoms. Each record status atom includes elements 77A-77I corresponding to elements 70A-70I in Figure 5. Element 77A includes the record status atom ID assigned by the create table directory atom. Pointers 77B and 77C identify the main directory and table directory atoms, respectively. Element 77J is an array for locating all data atoms managed by the record status atom 77. Element 77K contains the record number for the "basic record". That is, each data atom stores multiple records. Element 77 is a pointer to the corresponding table atom.
在本发明针对的数据库应用中,多个用户可以产生同一记录的多个版本。本发明的优选实施例使用多版本并发控制(MVCC)以通过下述方式来保证事务从不必须等待数据库:允许记录或其他对象的几个版本同时存在于数据库中。结果,每一个记录状态原子77包括关于每一个记录版本的元数据。条目77M是用于识别在垃圾收集中有用的每一个有版本的记录的位置的位图。In database applications targeted by the present invention, multiple users can generate multiple versions of the same record. A preferred embodiment of the present invention uses multi-version concurrency control (MVCC) to ensure that transactions never have to wait for the database by allowing several versions of a record or other object to exist in the database simultaneously. Consequently, each record state atom 77 includes metadata about each record version. Entry 77M is a bitmap identifying the location of each versioned record that is useful in garbage collection.
记录状态原子77对于记录的每一个版本77N包括事务ID 77P,以识别生成版本的事务。格式版本条目77Q识别当插入记录时存在的表格子类型的版本编号。这个格式识别记录的物理顺序,并且识别在创建记录版本时在使用中的数据库程序的、记录所属的子类型。元素77R包括记录版本序列号;元素77S,记录的下一个更旧的或前一个版本的位置。对于数据原子阵列77J的索引77T和基本记录标识77K一起提供了在具有记录版本的数据原子中的实际时隙77U的地址。The record status atom 77 includes a transaction ID 77P for each version 77N of the record to identify the transaction that generated the version. The format version entry 77Q identifies the version number of the table subtype that existed when the record was inserted. This format identifies the physical order of the records and identifies the subtype to which the record belongs for the database program in use when the record version was created. Element 77R includes the record version sequence number; element 77S, the position of the next older or previous version of the record. The index 77T and the base record identifier 77K to the data atom array 77J together provide the address of the actual time slot 77U in the data atom that has the record version.
图13描述了具有与在图5中的元素70A-70I对应的元素78A-78I的数据原子78。在数据原子78中,元素78A是由表格目录原子分配的数据原子标识78A。元素78B和78C分别是指向主目录原子和指向对应的表格目录原子的指针。ID管理器78J对于在数据原子78中的每一个记录分配记录时隙标识。元素78K对于在数据原子78中的每一个记录识别那个记录的地址和长度。元素78C表示数据记录和其版本。FIG13 illustrates a data atom 78 having elements 78A-78I corresponding to elements 70A-70I in FIG5 . In data atom 78, element 78A is a data atom identifier 78A assigned by a table directory atom. Elements 78B and 78C are pointers to a master directory atom and a corresponding table directory atom, respectively. ID manager 78J assigns a record slot identifier to each record in data atom 78. Element 78K identifies the address and length of each record in data atom 78. Element 78C represents a data record and its version.
现在,参见图14,数据库也存储“大二进制对象记录”。“大二进制对象记录”通常是在数据库中作为单个实体存储的二进制数据的集合。大二进制对象记录在版本中不存在。大二进制对象状态原子包括与在图5中的元素70A-70I对应的元素80A-80I。元素80A具有大二进制对象状态原子唯一原子标识。元素80B和80C分别是指向主目录和表格目录原子的指针。列表80J识别由单个大二进制对象状态原子80管理的所有大二进制对象原子。条目80K提供了基本大二进制对象记录的标识。元素80L指向对应的表格原子。对于每一个大二进制对象记录,大二进制对象状态原子包括对于大二进制对象原子的索引80M。元素80N识别在用于大二进制对象记录的大二进制对象原子中的时隙。Now, referring to Figure 14, the database also stores "large binary object records". A "large binary object record" is typically a collection of binary data stored as a single entity in the database. Large binary object records do not exist in the version. The large binary object state atom includes elements 80A-80I corresponding to elements 70A-70I in Figure 5. Element 80A has a large binary object state atom unique atom identifier. Elements 80B and 80C are pointers to the main directory and table directory atoms, respectively. List 80J identifies all large binary object atoms managed by a single large binary object state atom 80. Entry 80K provides the identifier of the basic large binary object record. Element 80L points to the corresponding table atom. For each large binary object record, the large binary object state atom includes an index 80M for the large binary object atom. Element 80N identifies the time slot in the large binary object atom used for the large binary object record.
图15描述了具有分别与在图5中的元素70A-70I对应的元素81A-81I的大二进制对象原子81。元素81A是由表格目录原子分配的原子标识。元素81B和81C分别是指向主目录原子和对应的表格目录原子的指针。ID管理器81J向在大二进制对象原子81中的每一个大二进制对象分配大二进制对象时隙标识。元素81K对于在大二进制对象原子78中的每一个大二进制对象识别其地址和长度。元素81L表示向大二进制对象原子分配的所有大二进制对象记录。FIG15 depicts a large binary object atom 81 having elements 81A-81I corresponding to elements 70A-70I in FIG5 , respectively. Element 81A is an atom identifier assigned by a table directory atom. Elements 81B and 81C are pointers to a master directory atom and a corresponding table directory atom, respectively. An ID manager 81J assigns a large binary object slot identifier to each large binary object in the large binary object atom 81. Element 81K identifies the address and length of each large binary object in the large binary object atom 78. Element 81L represents all large binary object records assigned to the large binary object atom.
总之,每一个原子具有仅与数据库的片断的关系。例如,数据库原子72包含识别用于数据库的图式的元数据。每一个图式原子73包含识别与那个图式相关联的所有表格的元数据。对于每一个表格,表格原子74和对应的表格目录原子75提供了关于包含诸如字段和它们的属性的标识的信息的表格的元数据。记录状态原子包括关于一组记录的元数据。数据原子包括关于每一个数据记录的信息,该每一个数据记录具有指向包含这些记录和各个版本的时隙的指针。大二进制对象状态和大二进制对象原子包含关于大二进制对象记录的类似的信息。In summary, each atom has a relationship to only a fragment of the database. For example, the database atom 72 contains metadata identifying the schema for the database. Each schema atom 73 contains metadata identifying all tables associated with that schema. For each table, a table atom 74 and a corresponding table directory atom 75 provide metadata about the table including information such as the identification of the fields and their attributes. The record status atom includes metadata about a set of records. The data atom includes information about each data record with a pointer to the slot containing the records and their versions. The large binary object state and large binary object atoms contain similar information about large binary object records.
消息information
如前所述,在任何两个节点之间的通信是借助于串行化的消息,该串行化的消息是使用TCP或具有用于维持消息传送序列的控制的另一个协议来异步地发送的。图16描述了包括可变长度报头91和可变长度主体92的典型消息90的基本句法。报头91包括指定消息和其功能的消息标识符代码93。因为本发明设想不同的节点可以使用不同的软件版本来操作的情况,所以报头91也包括创建该消息的软件版本的标识94。在报头中剩余的元素包括发送者的局部标识95(即,来自在图5中的主目录原子)和消息的目的地,即,目录原子的信息96(例如,在图10中的表格目录ID 75A)和原子标识97(例如,在图12中的记录状态ID77A)。从这个信息,接收方节点可以去串行化、解码和处理该消息。As previously described, communication between any two nodes is by means of serialized messages that are sent asynchronously using TCP or another protocol with controls for maintaining the sequence of message transmission. FIG16 illustrates the basic syntax of a typical message 90 comprising a variable-length header 91 and a variable-length body 92. The header 91 includes a message identifier code 93 that specifies the message and its function. Because the present invention contemplates situations where different nodes may operate using different software versions, the header 91 also includes an identification 94 of the software version that created the message. The remaining elements in the header include a local identification 95 of the sender (i.e., from the main directory atom in FIG5 ) and the destination of the message, i.e., information 96 of the directory atom (e.g., table directory ID 75A in FIG10 ) and an atom identification 97 (e.g., record status ID 77A in FIG12 ). From this information, the receiving node can deserialize, decode, and process the message.
图17描述了用于本发明的特定实施例的具有图16的句法的消息集。每一个执行现在将描述的特定功能。Figure 17 depicts a set of messages having the syntax of Figure 16 for use with a particular embodiment of the invention. Each performs a specific function which will now be described.
如前简述,当要发送消息时,存在到不同节点的不同通信路径。例如,如果作为请求节点的一个节点需要获得原子,则那个原子的复制可以位于多个其他节点中。在这个实施例中,“pinging”提供了对选择最佳路径对应节点有用的选择信息。如已知,pinging包括确定“ping”命令到达其目的地和接收到确认消息的时间。在本发明的这个实施例中,每一个节点定期地使用助手类来向它连接到的其他节点的每一个发送ping消息110。每个接收节点使用助手类来返回包含ping时间的ping确认消息111。每个节点在相对于图8下述的节点对象中累积关于发送和接收这些消息的时间的这个信息。当一个节点准备向多个节点之一发送消息时,发送节点分析包括但是不限于所累积的ping数据的因素,以将节点之一选择为用于那个消息的接收节点。As briefly described above, when a message is to be sent, there are different communication paths to different nodes. For example, if a node acting as a requesting node needs to obtain an atom, a copy of that atom may be located in multiple other nodes. In this embodiment, "pinging" provides selection information useful for selecting the node corresponding to the best path. As is known, pinging includes determining the time it takes for a "ping" command to reach its destination and receive a confirmation message. In this embodiment of the invention, each node periodically uses a helper class to send a ping message 110 to each of the other nodes it is connected to. Each receiving node uses a helper class to return a ping confirmation message 111 containing the ping time. Each node accumulates this information about the time of sending and receiving these messages in a node object described below with respect to FIG. 8. When a node is ready to send a message to one of multiple nodes, the sending node analyzes factors including, but not limited to, the accumulated ping data to select one of the nodes as the receiving node for that message.
下一个消息集涉及将新的节点连接到在图1中的数据库系统30内或将先前的不活动节点连接回在图1中的数据库系统30内。当例如事务节点N2的这样的节点希望连接到数据库系统30时,它启动下面相对于图19详细描述的连接处理。参见图17,一旦那个处理识别了用于接收消息的活动节点,则加入节点向所选择的节点发送连接消息112。所选择的节点向在数据库系统30中的所有其他连接的节点返回欢迎消息113和新节点消息114。其他连接的节点中的每一个向加入节点发送其本身的欢迎消息113。当这个消息序列完成时,加入的节点然后可以进行进一步的步骤以获得各种原子。The next set of messages involves connecting a new node into the database system 30 in FIG. 1 or connecting a previously inactive node back into the database system 30 in FIG. 1 . When such a node, such as transaction node N2, wishes to connect to the database system 30, it initiates the connection process described in detail below with respect to FIG. 19 . Referring to FIG. 17 , once that process identifies an active node for receiving messages, the joining node sends a connect message 112 to the selected node. The selected node returns a welcome message 113 and a new node message 114 to all other connected nodes in the database system 30. Each of the other connected nodes sends its own welcome message 113 to the joining node. When this message sequence is complete, the joining node can then proceed to further steps to obtain various atoms.
档案节点可以当它们与另一个节点同步时在活动模式或同步模式中操作。在档案节点中的助手类发送节点状态消息115,以向所有其他节点警告在那个档案节点中的任何状态改变。Archive nodes can operate in active mode or synchronization mode when they are synchronized with another node.A helper class in an archive node sends node status messages 115 to alert all other nodes of any status changes in that archive node.
当作为请求节点的节点从另一个节点检索原子的副本时,涉及下一个消息集。例如,在节点加入在图1中的数据库系统30后,它一般请求主目录原子的副本。结合图20和21的解释更详细地描述了该处理。The next set of messages is involved when a node, acting as a requesting node, retrieves a copy of an atom from another node. For example, after a node joins the database system 30 in FIG1 , it typically requests a copy of the master directory atom. This process is described in more detail in conjunction with the explanation of FIG20 and FIG21 .
仍然参见图17,请求节点向选择的节点发出对象请求消息116,该选择的节点通常返回具有请求的原子的对象消息117。所选择的节点还向具有该原子的所有其他节点发送对象可用消息118。从所选择的节点接收对象可用消息118的每一个节点向所选择的节点返回对象确认消息119。在所选择的节点接收到所有的对象确认消息119后,所选择的节点向请求节点发送对象完成消息120。Still referring to FIG17 , the requesting node sends an object request message 116 to the selected node, which typically returns an object message 117 with the requested atom. The selected node also sends an object available message 118 to all other nodes with the requested atom. Each node that receives the object available message 118 from the selected node returns an object confirmation message 119 to the selected node. After the selected node has received all object confirmation messages 119, the selected node sends an object completion message 120 to the requesting node.
在一些情况下,所选择的节点发送对象不可用消息121以声明所选择的节点已经丢弃了所请求的原子。来自所选择的节点的弹回对象消息指示在主目录原子或表格目录原子之一中未找到所请求的原子。这可能出现在当更新事务在进行中并且所选择的节点不响应于对象请求消息116时,因为垃圾收集处理已经在接收到对象请求消息前收集了那个原子。作为响应,请求的事务节点可以在具有该原子的数据库系统中选择另一个节点。In some cases, the selected node sends an object unavailable message 121 to declare that the selected node has discarded the requested atom. The bounce object message from the selected node indicates that the requested atom was not found in one of the main directory atom or the table directory atom. This may occur when an update transaction is in progress and the selected node does not respond to the object request message 116 because the garbage collection process has collected the atom before the object request message was received. In response, the requesting transaction node can select another node in the database system that has the atom.
在图1和图4A和4B中的数据库请求引擎41可以定期地生成注册对象消息123或解除注册对象消息124。这些消息针对包括注册表的原子,诸如数据库和图式原子。当在节点处的用户发出删除诸如表格的某个项目的命令时,从那个节点发送对象删除消息125。The database request engine 41 in FIG1 and FIG4A and 4B can periodically generate a register object message 123 or a deregister object message 124. These messages are for atoms comprising a register, such as database and schema atoms. When a user at a node issues a command to delete an item, such as a table, an object delete message 125 is sent from that node.
每当更新或修改局部节点时,其改变编号递增。每一个复制消息包含那个原子的本地改变编号。每一个原子跟踪每一个节点的最新的改变编号。当档案节点接收到修改的原子的副本时,它复制原子的改变编号,清除改变编号,然后将原子串行化到盘。如果已经进行了改变,则改变编号将不是零。档案节点发送具有向每一个节点写入的改变编号的对象写入消息126。每一个接收节点将其自己的改变编号与该消息中的改变编号进行比较。然后,该节点可以更新原子的状态以注意原子已经被归档并且是垃圾收集的潜在候选者。Whenever a local node is updated or modified, its change number is incremented. Each replication message contains the local change number for that atom. Each atom keeps track of the latest change number for each node. When an archive node receives a copy of a modified atom, it copies the atom's change number, clears the change number, and then serializes the atom to disk. If changes have been made, the change number will be non-zero. The archive node sends an object write message 126 with the change number written to each node. Each receiving node compares its own change number with the change number in the message. The node can then update the state of the atom to note that the atom has been archived and is a potential candidate for garbage collection.
如前所示,每一个原子必须具有唯一的身份。当创建特定原子类型的第一原子(例如,新的表格原子)时,将创建事务节点指定为那个表格原子的主席。下面说明用于控制“主席身份”的规则。每当事务节点需要创建新的原子类型时,如果它没有可用的标识,则它向主席发送ID请求消息127。主席通常返回ID委托消息128,该消息包括来自其自由标识值的分配的至少一个唯一标识的块。将相对于图20的处理来更详细地描述这个处理。As previously indicated, each atom must have a unique identity. When the first atom of a particular atom type is created (e.g., a new table atom), the creating transaction node is designated as the chairperson of that table atom. The rules for controlling the "chairperson identity" are described below. Whenever a transaction node needs to create a new atom type, if it does not have an identity available, it sends an ID request message 127 to the chairperson. The chairperson typically returns an ID delegation message 128, which includes a block of at least one unique identity from its allocation of free identity values. This process will be described in more detail with respect to the process of Figure 20.
参见图4A和4B,表格原子74可以发送多个消息的任何一个。如果数据库请求引擎41启动用于添加新的字段的处理,则在那个对应的事务节点的表格原子生成新的结构,并且发送表格字段添加消息129,该表格字段添加消息129向包括那个表格原子的所有其他节点复制该改变。如果事务节点更新了改变表格格式的字段、子类型或字段特性,则那个节点发出表格格式消息130。每当节点需要创建新的记录状态或大二进制对象状态原子时,生成表格请求记录消息131。仅主席可以创建这个原子;并且,当这种情况出现时,主席广播表格记录对象消息132。4A and 4B , the table atom 74 can send any one of a number of messages. If the database request engine 41 initiates processing for adding a new field, the table atom at that corresponding transaction node generates the new structure and sends a table field add message 129, which replicates the change to all other nodes that include that table atom. If a transaction node updates a field, subtype, or field attribute that changes the table format, that node issues a table format message 130. Whenever a node needs to create a new record state or large binary object state atom, a table request record message 131 is generated. Only the chairperson can create this atom; and, when this occurs, the chairperson broadcasts a table record object message 132.
每次事务节点在表格中插入新的记录时,它产生表格记录消息133。每当变得需要创建新的索引时,如当向表格添加有索引的字段时那样,创建表格原子复制新的表格原子。此时,将索引设置为仅写入索引。在已经完成了所涉及的所有相关处理后,节点发送表格索引添加消息134。Each time a transaction node inserts a new record into a table, it generates a table record message 133. Whenever a new index needs to be created, such as when adding an indexed field to a table, the create table atom copies the new table atom. In this case, the index is set to a write-only index. After all the relevant processing involved has completed, the node sends a table index add message 134.
在表格原子创建用于大二进制对象的大二进制对象状态原子的任何时间,表格原子生成表格大二进制对象对象消息135。表格大二进制对象消息136指示已经创建了新的大二进制对象。Any time a table atom creates a large binary object state atom for a large binary object, the table atom generates a table large binary object message 135. The table large binary object message 136 indicates that a new large binary object has been created.
在利用类型和子类型的数据库中,在图1中的数据库请求引擎41将生成用于使得表格原子分配新的表格类型标识的命令。当这种情况出现时,向具有相似的表格原子的所有节点复制表格类型消息137。In a database that utilizes types and subtypes, the database request engine 41 in Figure 1 will generate a command for causing a table atom to be assigned a new table type identifier. When this occurs, a table type message 137 is replicated to all nodes that have similar table atoms.
表格记录擦除消息138提供了关于特定记录状态原子的记录编号。当确定在那个表格内的记录包含反向版本或其他准则的异常地长的链时,表格原子的主席生成表格垃圾收集消息139。结果是“未使用的”原子被“清空”数据。A table record erase message 138 provides the record number associated with a particular record status atom. When it is determined that a record within that table contains an unusually long chain of reversed versions or other criteria, the chairperson of the table atom generates a table garbage collection message 139. The result is that "unused" atoms are "purged" of data.
在图4A和4B中的记录状态原子77也产生了几个特殊的消息。如果变得需要更新特定记录,则本发明的数据库管理系统创建那个记录的新版本。向回参见图17,对应的记录状态原子生成记录更新请求消息140,记录更新请求消息140被引导到那个原子的主席,以寻求更新那个特定记录的许可。主席通过生成记录更新响应消息141来响应,记录更新响应消息141准许或拒绝对于更新那个记录的许可。如果主席准许许可,则请求记录状态原子执行更新,并且向具有那个原子的副本的每一个节点发送具有该原子的新版本的记录更新消息142。The record status atom 77 in Figures 4A and 4B also generates several special messages. If it becomes necessary to update a particular record, the database management system of the present invention creates a new version of that record. Referring back to Figure 17, the corresponding record status atom generates a record update request message 140, which is directed to the chairman of that atom to seek permission to update that particular record. The chairman responds by generating a record update response message 141, which grants or denies permission to update that record. If the chairman grants permission, the record status atom is requested to perform the update, and a record update message 142 with the new version of the atom is sent to each node that has a copy of that atom.
数据原子存储多达某个最大数量的记录和其版本。对应的记录状态原子监视它管理的数据原子的大小。如果记录状态原子确定被管理的数据原子已经超过那个大小,则它生成新的数据原子,并且借助于记录数据对象消息143来复制该新的数据原子。Data atoms store up to a certain maximum number of records and their versions. The corresponding record status atom monitors the size of the data atoms it manages. If the record status atom determines that the managed data atom has exceeded that size, it generates a new data atom and copies the new data atom with the help of a record data object message 143.
记录状态原子生成记录记录消息144,用于复制任何新的记录版本。定期地,表格原子主席启动下述处理,通过该处理,记录状态原子识别比最旧的活动事务更旧的记录版本。当这种情况出现时,主席的记录状态原子发送记录删除消息145,记录删除消息145使得能够在随后的垃圾收集处理期间删除那些更旧的记录版本。如果出现其中变得需要恢复事务的情况,则记录状态原子生成更新撤消记录的撤消记录消息146。The record status atom generates a record record message 144 for replicating any new record versions. Periodically, the table atom chair initiates a process by which the record status atom identifies record versions older than the oldest active transaction. When this occurs, the chair's record status atom sends a record delete message 145, which enables deletion of those older record versions during a subsequent garbage collection process. If a situation arises in which a transaction recovery becomes necessary, the record status atom generates an undo record message 146 that updates the undo record.
也存在索引特定的消息集。如所知,索引具有最佳的最大大小;并且,如果索引超过那个大小,则索引应当被分割。根据本发明,仅主席可以分割索引原子。主席可以单方面地或响应于来自那个原子的另一个副本的索引分割请求消息147而如此进行。当主席引起该分割时,主席生成包含分割索引的索引分割消息148。在该分割后,主席发送索引删除消息149,以在分割后删截原始索引原子。每次向索引添加索引节点时,它生成包含索引键、记录标识和新的索引的其他信息的索引节点添加消息。当已经完全填充索引并且因此索引准备好在检索操作期间使用时,生成表格索引就绪消息151。如前所示,添加表格索引生成索引原子,它是仅写入索引并且是不可读的。表格索引就绪消息151使得这样的仅写入索引是可读的。There is also an index-specific set of messages. As is known, an index has an optimal maximum size; and if the index exceeds that size, the index should be split. According to the present invention, only the chairman can split an index atom. The chairman can do so unilaterally or in response to an Index Split Request message 147 from another copy of that atom. When the chairman causes the split, the chairman generates an Index Split message 148 containing the split index. After the split, the chairman sends an Index Delete message 149 to truncate the original index atom after the split. Each time an index node is added to the index, it generates an Index Node Add message containing the index key, record identifier, and other information of the new index. When the index has been fully populated and is therefore ready to be used during retrieval operations, a Table Index Ready message 151 is generated. As previously shown, adding a table index generates an index atom, which is a write-only index and is not readable. The Table Index Ready message 151 makes such a write-only index readable.
大二进制对象状态原子通过生成大二进制对象大二进制对象消息152来在大二进制对象原子中识别时隙。The large binary object state atom identifies a time slot in the large binary object atom by generating a large binary object large binary object message 152.
数据记录消息153包含时隙编号和记录长度。它也包括数据记录。The data record message 153 contains the time slot number and the record length. It also includes the data record.
当事务的状态改变时,用于给定的事务节点的事务管理器原子71生成事务状态消息154。这些指示事务的当前状态是在活动状态、提交前状态、提交状态还是恢复状态中。在特定的情况下,有可能与一个事务相关的请求将被在另一个节点上的另一个事务阻挡。在那种情况下,事务管理器原子接收事务阻挡消息155。如果事务被僵持并且必须被恢复,则与引起僵持的节点相关联的事务管理器原子生成事务僵持消息156,该消息使得事务恢复。When the state of a transaction changes, the transaction manager atom 71 for a given transaction node generates transaction status messages 154. These indicate whether the current state of the transaction is active, pre-commit, committed, or recovered. In certain circumstances, it is possible that a request associated with one transaction will be blocked by another transaction on another node. In that case, the transaction manager atom receives a transaction blocked message 155. If a transaction is stuck and must be recovered, the transaction manager atom associated with the node causing the deadlock generates a transaction deadlock message 156, which causes the transaction to be recovered.
在档案节点上的主目录或任何表格目录原子可以请求最后写入原子的时间。这出现在当请求节点发送请求写入时间消息158时。然后,那个消息的接收方在写入时间消息159中返回那些请求的时间。The time of the last write to an atom can be requested for the home directory or any table directory atom on an archive node. This occurs when the requesting node sends a Request Write Time message 158. The recipient of that message then returns those requested times in a Write Time message 159.
前述的消息构成一个集,通过该集,可以正确地处理用于维持包含本公开的数据库管理系统所需的各种过程。如将显而易见的,每一个消息具有在报头中的最小开销。每一个消息可以合理地短。当与TCP或其他消息传送协议一起使用时,必须依序发送所述消息,并且在任何给定的节点,在接收到时,必须以其中它们甚至被不同的节点发送的相同顺序来处理它们。The aforementioned messages constitute a set by which the various processes required to maintain a database management system incorporating the present disclosure can be properly handled. As will be apparent, each message has minimal overhead in the header. Each message can be reasonably short. When used with TCP or other messaging protocols, the messages must be sent in sequence, and at any given node, upon receipt, they must be processed in the same order in which they were sent, even by different nodes.
方法method
其将对进一步理解描述与本发明的操作的各个方面相关的一些基本方法的本发明有用。相对于每一个的变化对于本领域内的普通技术人员将是显而易见的。It will be useful to further understand the invention describing some basic methods associated with various aspects of the operation of the invention. Variations with respect to each will be apparent to those of ordinary skill in the art.
图18是当节点加入网络时在图1的数据库系统30中的不同节点中出现的操作的流程图。为了本说明的目的,假定在图1中的节点5要加入数据库系统;它被指定为加入的事务节点170。作为第一处理,加入的事务节点170使用步骤171来与选择的节点建立TPC连接。基本上,加入的事务节点170向识别数据库的固定位置发送消息。未示出但是在本领域中已知的连接代理通过拒绝或许可对于数据库系统的访问来响应于这个请求。如果连接代理许可访问,则它选择诸如事务节点N1的节点来作为选择的节点172。然后,连接代理向具有选择的节点172的、作为端口编号的指定的加入的事务节点170发送消息。图18也将在数据库系统中的所有其他活动事务和档案节点表示为组173。FIG18 is a flow chart of the operations that occur in various nodes in database system 30 of FIG1 when a node joins the network. For the purposes of this description, assume that node 5 in FIG1 is joining the database system; it is designated as joining transaction node 170. As a first step, joining transaction node 170 uses step 171 to establish a TPC connection with a selected node. Essentially, joining transaction node 170 sends a message to a fixed location identifying the database. A connection agent, not shown but known in the art, responds to this request by either denying or granting access to the database system. If the connection agent grants access, it selects a node, such as transaction node N1, as selected node 172. The connection agent then sends a message to joining transaction node 170, designating selected node 172 as the port number. FIG18 also represents all other active transaction and archive nodes in the database system as group 173.
一旦在步骤171中建立了连接,则加入的事务节点170使用步骤174来向所选择的节点172发送连接消息。所选择的节点172通过下述方式来在步骤175响应于连接消息:使用其连接管理器来更新其主目录原子,向加入的事务节点170分配局部节点ID,并且向在其节点对象中的局部节点的阵列增加那个节点,在图19中示出一个示例。Once the connection is established in step 171, the joining transaction node 170 uses step 174 to send a connect message to the selected node 172. The selected node 172 responds to the connect message in step 175 by using its connection manager to update its home directory atom, assigning a local node ID to the joining transaction node 170, and adding that node to the array of local nodes in its node object, an example of which is shown in FIG.
图19描述了诸如结合图18的步骤175描述的节点对象。它包含指向用于节点的套接字的指针400A和指向在该节点处的主目录原子的指针400B和指向在主目录原子中的连接管理器的指针400C。指针400D识别用于收听进入的消息的线程,并且指针400E识别用于接收消息的套接字缓冲器。该消息收听者等待消息,确定消息类型,然后处理该消息至完成。FIG19 depicts a node object such as that described in conjunction with step 175 of FIG18. It contains a pointer 400A pointing to the socket for the node, a pointer 400B pointing to the home directory atom at the node, and a pointer 400C pointing to the connection manager in the home directory atom. Pointer 400D identifies the thread for listening for incoming messages, and pointer 400E identifies the socket buffer for receiving messages. The message listener waits for a message, determines the message type, and then processes the message to completion.
节点对象400如所有的原子那样包括这个节点在收听的节点的全局节点ID 400F和局部节点ID 400G。元素400H是指向等待要从节点发送的消息的队列的指针。元素400I和400J包含局部端口和远程端口的标识。元素400K包含用于在远程节点处操作的软件的版本编号。节点类型元素400L指示远程节点是事务节点、进行同步处理的档案节点还是在线的档案节点。Node object 400 comprises the global node ID 400F and local node ID 400G of the node that this node is listening to as all atoms.Element 400H is the pointer to the queue that points to and waits for the message that will send from node.Element 400I and 400J comprise the identification of local port and remote port.Element 400K comprises the version number of the software that is used to operate at remote node place.Node type element 400L indicates whether remote node is transaction node, archive node that carries out synchronous processing or online archive node.
元素400M包含局部节点的名称;元素400N包含远程节点的名称。元素400P是指向被处理的当前消息的指针。元素400Q和400R识别最后ping操作的时间和ping时间。如前所示,每一个节点响应于用于在那个节点处启动的事务的每一个提交操作来生成依序提交序列号。元素400S包含这个编号。元素400T指示这个节点对象是否是用于这个节点的节点对象。Element 400M contains the name of the local node; element 400N contains the name of the remote node. Element 400P is a pointer to the current message being processed. Elements 400Q and 400R identify the time and ping time of the last ping operation. As previously shown, each node generates a sequential submission sequence number in response to each commit operation for a transaction initiated at that node. Element 400S contains this number. Element 400T indicates whether this node object is a node object for this node.
向回参见图18,在步骤176处,所选择的节点172向包含全局节点ID的加入的事务节点170发送欢迎消息。然后,所选择的节点在步骤177中向所有其他事务和档案节点的组173广播新的节点消息。18, at step 176, the selected node 172 sends a welcome message to the joining transaction node 170 containing the global node ID. The selected node then broadcasts a new node message to the group 173 of all other transaction and archive nodes in step 177.
在组173中的每一个节点在步骤180通过下述方式来响应于新的节点消息:记录全局ID,并且分配加入的档案节点的局部ID,并且更新在它们相应的主目录原子中的所有连接的节点的局部列表。每一个然后使用步骤181来向加入的事务节点170发送欢迎消息。在完成这个处理时,加入的事务节点170具有包括所选择的节点172和在组173中的所有节点的所有活动节点的完全列表。Each node in group 173 responds to the new node message by recording the global ID and assigning the local ID of the joining archive node and updating the local list of all connected nodes in their respective home directory atoms in step 180. Each then uses step 181 to send a welcome message to the joining transaction node 170. Upon completion of this process, the joining transaction node 170 has a complete list of all active nodes, including the selected node 172 and all nodes in group 173.
当加入的事务节点170在步骤182从所选择的节点接收欢迎消息时,它向所选择的节点172发送对象请求消息(步骤183),以请求主目录原子的副本。在所选择的节点172已经更新了在其主目录原子中的各个信息项后,所选择的节点实现步骤184,以串行化在被发送到加入的事务节点170的对象消息中的其主目录原子,并且向在系统中的所有其他节点广播对象可用消息。因此,更新和同步在每一个节点中的主目录原子。When the joining transaction node 170 receives the welcome message from the selected node in step 182, it sends an object request message to the selected node 172 (step 183) to request a copy of the master directory atom. After the selected node 172 has updated the various information items in its master directory atom, the selected node implements step 184 to serialize its master directory atom in the object message sent to the joining transaction node 170 and broadcast the object available message to all other nodes in the system. Thus, the master directory atom in each node is updated and synchronized.
不用等待对象消息的接收,加入的事务节点也可以开始步骤185的处理,用于从所选择的节点172检索数据库原子和事务管理器原子的副本。Without waiting for receipt of an object message, the joining transaction node may also begin processing at step 185 for retrieving copies of database atoms and transaction manager atoms from the selected node 172 .
接收对象可用消息的每一个其他节点在步骤186中通过向所选择的节点发回对象确认消息来响应。Each other node that receives the object available message responds in step 186 by sending an object confirmation message back to the selected node.
在加入节点中的数据库请求引擎启动这个序列。因此,当已经完成图18的方法时,加入的事务节点170连接到数据库系统,并且如图4A和4B中所示,包括主目录原子70、事务管理器原子71和数据库原子72的副本。加入的事务节点170其后将在按需的基础上创建或获得其他原子的副本。The database request engine in the joining node initiates this sequence. Thus, when the method of FIG. 18 has been completed, the joining transaction node 170 is connected to the database system and, as shown in FIG. 4A and 4B , includes copies of the master directory atom 70, the transaction manager atom 71, and the database atom 72. The joining transaction node 170 will thereafter create or obtain copies of the other atoms on an as-needed basis.
在一些操作期间,事务节点可能创建新的表格,使得新的表格原子的创建成为必要。图20公开了处理190,其中,节点A是请求节点,原子X是请求并且将管理新的原子Y的原子。为了创建新的表格原子Y,原子X将是图式原子,并且局部目录Z将是主目录原子。步骤191表示用于获得原子Y的实例的请求的准备功能。每次改变原子时,它被分配改变编号;初始值通常是“0”。During some operations, a transaction node may create a new table, necessitating the creation of a new table atom. FIG20 discloses a process 190 in which node A is the requesting node and atom X is the atom that requests and will manage a new atom Y. To create a new table atom Y, atom X will be a schema atom and local directory Z will be a master directory atom. Step 191 represents the preparation function for the request to obtain an instance of atom Y. Each time an atom is changed, it is assigned a change number; the initial value is usually "0".
在步骤192,局部目录Z创建没有内容的原子Y的实例,并且将局部节点指定为原子Y的主席。然后,处理193允许本地目录Z向新的原子Y分配对象ID。相对于图21示出和描述了这样的处理的细节。At step 192, local directory Z creates an instance of atom Y with no content and designates the local node as the chairperson of atom Y. Process 193 then allows local directory Z to assign an object ID to the new atom Y. Details of such processing are shown and described with respect to FIG.
接下来,局部目录Z设置排他锁定,以允许对于它的改变出现,而没有来自外部自动化的任何影响。当该锁定在位时,局部目录Z将新原子Y的状态设置为“肮脏”状态和“非开放”状态。“肮脏”状态指示新的原子Y还没有被复制到档案。“非开放”状态指示新原子Y对于其他节点还不可用。在步骤195处,局部目录Z更新其本身,然后释放该排他锁定。在步骤196处,目录Z向在事务和档案节点中的目录Z的所有其他实例广播用于识别原子Y的对象可用消息。Next, local directory Z sets an exclusive lock to allow changes to it to occur without any influence from external automation. While the lock is in place, local directory Z sets the state of the new atom Y to a "dirty" state and a "non-open" state. The "dirty" state indicates that the new atom Y has not yet been copied to the archive. The "non-open" state indicates that the new atom Y is not yet available to other nodes. At step 195, local directory Z updates itself and then releases the exclusive lock. At step 196, directory Z broadcasts an object available message identifying atom Y to all other instances of directory Z in the transaction and archive nodes.
在步骤197,作为用于新的原子Y的管理原子的原子X填充原子Y的实例,并且将原子Y的状态设置为“开放”,用于指示可以复制该新的原子。其后的某个时间,档案节点将向永久存储器存储该新原子的副本。也就是,档案节点将通过下述方式来响应于对象可用消息的接收:请求原子Y的副本,由此提供冗余。当此完成时,来自档案节点的对象确认消息的接收将使得“肮脏”状态改变,并且这个改变然后被反映到具有原子Y的副本的所有其他节点。In step 197, Atom X, acting as the management atom for the new Atom Y, populates an instance of Atom Y and sets the state of Atom Y to "open," indicating that the new Atom can be replicated. Sometime thereafter, the archive node will store a copy of the new Atom to persistent storage. That is, the archive node will respond to the receipt of the Object Available message by requesting a copy of Atom Y, thereby providing redundancy. Upon completion, the receipt of the Object Confirmation message from the archive node will cause the "dirty" state to change, and this change will then be reflected to all other nodes that have a copy of Atom Y.
在用于分配对象ID的本发明的操作的各个阶段中使用在图20中的分配处理193和相似的分配处理。图21更详细地描述了这个分配处理。具体地说,当目录原子想要分配对象ID时,在步骤200确定它是否具有对于它可用的局部ID。如果它具有,则控制转到步骤201,该步骤响应于请求而分配可用ID。如果局部ID不可用,则控制转到步骤202,以确定在这个节点处的目录原子是否具有“主席”状态。如果是,则主席具有用于直接地识别可用ID的授权,并且控制转到步骤201。The allocation process 193 in Figure 20 and similar allocation processes are used in various stages of the operation of the present invention for allocating object IDs. Figure 21 describes this allocation process in more detail. Specifically, when a directory atom wants to allocate an object ID, it determines in step 200 whether it has a local ID available for it. If it does, control passes to step 201, which allocates an available ID in response to the request. If the local ID is not available, control passes to step 202 to determine whether the directory atom at this node has "chairman" status. If so, the chairman has authorization to directly identify an available ID, and control passes to step 201.
如将想起的,当对于特定原子存在至少一个其他节点时,每一个原子包含包括正被请求的原子的副本的节点的列表。如果这是在已经根据图20的处理而创建了原子后对于那个原子的第一请求,则在列表上的第一节点中的对应的目录是主席。步骤203表示选择节点和识别主席的处理。对于该选择处理,优选的是,首先与事务节点建立通信。步骤204表示ID请求消息向主席的发送。As will be recalled, when there is at least one other node for a particular atom, each atom contains a list of nodes that include a copy of the atom being requested. If this is the first request for that atom after the atom has been created according to the process of Figure 20, the corresponding directory in the first node on the list is the chairman. Step 203 represents the process of selecting a node and identifying the chairman. For this selection process, it is preferred that communication is first established with the transaction node. Step 204 represents the sending of an ID request message to the chairman.
当主席在步骤205接收到ID请求消息时,它获得可用ID编号的块(步骤206)。主席将作出该请求的事务节点识别为可用ID编号的这个块的地点(步骤207)。然后,主席在步骤210向请求的节点发送ID委托消息。当请求的节点在步骤211从主席接收到ID委托消息时,它在步骤212存储ID编号的块,然后在步骤201中选择用于分配的第一可用ID。向回参见图20,在该情况下,处理193从步骤200至步骤202直接地转到步骤201,因为在图20的步骤192中指定了主席。When the chairperson receives the ID request message in step 205, it obtains the block of available ID numbers (step 206). The chairperson identifies the transaction node making the request as the location of this block of available ID numbers (step 207). The chairperson then sends an ID delegation message to the requesting node in step 210. When the requesting node receives the ID delegation message from the chairperson in step 211, it stores the block of ID numbers in step 212 and then selects the first available ID for allocation in step 201. Referring back to FIG. 20 , in this case, process 193 proceeds directly from steps 200 to 202 to step 201 because the chairperson was designated in step 192 of FIG. 20 .
每当在图4A和4B中的数据库引擎41作出对于原子的请求时,处理在图22中的响应220。例如,假定在请求节点221中的数据库请求引擎41从具有其他节点223的数据库中的选择的节点222请求原子Y(例如,表格原子)的副本。当数据库请求引擎41作出那个要求时,步骤224确定是否在请求节点221中存在原子Y。如果是,则步骤225结束该处理,因为存在被请求的原子。如果否,则控制转到步骤226,据此,局部目录Z创建原子Y的空实例,并且将原子Y声明为“未填充”。如果数据库引擎41正请求表格原子74,则主目录原子70将执行这个步骤。步骤230然后使用前述的选择处理来识别选择的节点222。偏好是在将最具响应性的档案节点选择为选择的节点222之前选择事务节点中的任何一个。Whenever the database engine 41 in Figures 4A and 4B makes a request for an atom, the response 220 in Figure 22 is processed. For example, assume that the database request engine 41 in the requesting node 221 requests a copy of atom Y (e.g., a table atom) from a selected node 222 in the database with other nodes 223. When the database request engine 41 makes that request, step 224 determines whether atom Y exists in the requesting node 221. If so, step 225 ends the process because the requested atom exists. If not, control passes to step 226, whereupon the local directory Z creates an empty instance of atom Y and declares atom Y as "unpopulated". If the database engine 41 is requesting a table atom 74, the master directory atom 70 will perform this step. Step 230 then uses the aforementioned selection process to identify the selected node 222. The preference is to select any one of the transaction nodes before selecting the most responsive archive node as the selected node 222.
在步骤231中,请求节点221向所选择的节点222发送用于原子Y的对象请求消息。作为响应,所选择的节点222使用步骤232来以具有节点和序列号的其串行化形式来发送具有被请求的原子Y的对象消息。In step 231, the requesting node 221 sends an object request message for atom Y to the selected node 222. In response, the selected node 222 uses step 232 to send an object message with the requested atom Y in its serialized form with the node and sequence number.
同时,所选择的节点222向所有其他节点223广播对象可用消息。它也对于具有原子Y的副本的所有其他节点创建中继器列表。在处理中的该点处,其他节点不与在请求节点中的原子Y直接地进行通信,因为它们不知道它们应当向请求节点发送用于那个原子的复制消息。因此,当其他节点中的任何一个复制其原子Y时,所选择的节点222将向请求节点221中继该消息。At the same time, the selected node 222 broadcasts an object available message to all other nodes 223. It also creates a repeater list for all other nodes that have copies of atom Y. At this point in the process, the other nodes do not communicate directly with atom Y in the requesting node because they do not know that they should send a replication message for that atom to the requesting node. Therefore, when any of the other nodes replicates its atom Y, the selected node 222 will relay the message to the requesting node 221.
当请求节点221从所选择的节点222接收到对象消息时,它在步骤233进行消息的可访问性分析。如果消息包含当前的原子,则原子Y在步骤236处理该消息,并且在步骤237向所选择的节点发送对象确认消息。When the requesting node 221 receives the object message from the selected node 222, it performs accessibility analysis of the message in step 233. If the message contains the current atom, atom Y processes the message in step 236 and sends an object confirmation message to the selected node in step 237.
所有其他节点223使用步骤240来通过向所选择的节点222发送对象确认消息而响应于对象可用消息。所选择的节点222使用步骤241来监视该对象确认消息。具体地说,它响应于每一个对象确认消息而从其中继器列表去除其他节点中的每一个,并且停止向那个节点的中继。当已经从列表去除了所有其他接收223时,所选择的节点停止所有的中继,并且广播对象完成消息。All other nodes 223 respond to the object available message using step 240 by sending an object confirmation message to the selected node 222. The selected node 222 monitors the object confirmation messages using step 241. Specifically, it removes each of the other nodes from its repeater list in response to each object confirmation message and stops relaying to that node. When all other nodes 223 have been removed from the list, the selected node stops all relaying and broadcasts an object completion message.
另一个节点有可能在图22中的步骤226和236之间的时间期间发送到达请求节点221的复制消息。这可以中断消息处理。结果,当在未填充原子Y的同时在请求节点处接收到在上面的实例中的用于原子Y的复制消息时,它被置于作为每一个原子的一部分的待决消息列表中,虽然在图5至13的任何一个中未示出。It is possible that another node sends a Duplicate message that arrives at the requesting node 221 during the time between steps 226 and 236 in Figure 22. This can interrupt message processing. As a result, when a Duplicate message for atom Y in the above example is received at the requesting node while atom Y is not populated, it is placed on the pending message list as part of each atom, although not shown in any of Figures 5 to 13.
如前所示,本发明特别适于与事务处理技术对接的数据库。就此而论,应当包含用于“提交”消息的适当手段。图23描述了保证在这样的环境中的数据的一致性的一种手段。具体地说,图23描述了四个节点,即:事务节点A 250、事务节点B 251、事务节点C 252和档案节点253。假定事务节点B251在步骤254发送具有由在那个节点的事务管理器原子供应的事务ID的提交前消息。该消息在步骤255被路由到档案节点。当已经完成用于提交那个事务的所有条件时,档案节点255在步骤256发出提交事务消息,并且在步骤257,广播那个提交消息。事务节点的每一个在步骤258作为响应来更新其对应的事务编号。As previously indicated, the present invention is particularly well-suited for databases interfaced with transaction processing technology. In this regard, appropriate means for "commit" messages should be included. FIG. 23 illustrates one means for ensuring data consistency in such an environment. Specifically, FIG. 23 depicts four nodes: transaction node A 250, transaction node B 251, transaction node C 252, and archive node 253. Assume that transaction node B 251 sends a pre-commit message at step 254 with a transaction ID atomically supplied by the transaction manager at that node. This message is routed to the archive node at step 255. When all conditions for committing that transaction have been met, archive node 255 issues a commit transaction message at step 256 and, at step 257, broadcasts that commit message. Each of the transaction nodes responds by updating its corresponding transaction number at step 258.
如先前相对于在图21中的用于请求原子的副本的处理所描述的,请求的节点在步骤233对于任何接收到的消息执行访问性分析。这个测试提供了任何事务节点总是用有效的信息来操作的保证,并且涉及事务ID编号和提交序列号的分析。通过进一步理解事务ID和提交序列号,通过分析事务的相对顺序以及通过理解“原子偏斜”,将便利这个分析和本发明的其他特征的理解。As previously described with respect to the process for requesting a copy of an atom in FIG21 , the requesting node performs an accessibility analysis on any received message in step 233. This test provides assurance that any transaction node is always operating with valid information and involves analysis of transaction ID numbers and commit sequence numbers. This analysis and other features of the present invention will be facilitated by further understanding transaction IDs and commit sequence numbers, by analyzing the relative order of transactions, and by understanding "atom skew."
相对于事务ID和提交序列号,并且如前所述,每一个事务标识符在图1的整个数据库系统上是唯一的。事务ID的目的是唯一的、永久的、系统范围的标记,用于指示哪个事务创建了特定的记录版本。每一个事务ID被事务管理器原子71的局部副本分配,并且一个这样的事务管理器原子将是主席,该主席向在数据库系统中的每一个事务节点上的事务管理器原子分配标识符编号的块。在给定的事务节点处的事务管理器原子按顺序向那个接收开始的每一个事务分配在分配的块中的未使用的编号。结果,在给定节点处开始的较新的事务的事务ID可以比向在那同一节点上开始的更旧的事务分配的事务ID更高。然而,在系统范围的基础上,事务ID不暗示关于不同事务的相对开始时间的任何内容。With respect to transaction IDs and commit sequence numbers, and as previously described, each transaction identifier is unique across the entire database system of FIG. 1 . The purpose of a transaction ID is to be a unique, permanent, system-wide marker for indicating which transaction created a particular record version. Each transaction ID is assigned by a local copy of a transaction manager atom 71, and one such transaction manager atom will be the chairperson, which assigns a block of identifier numbers to the transaction manager atom on each transaction node in the database system. The transaction manager atom at a given transaction node sequentially assigns an unused number in the assigned block to each transaction that receives a start. As a result, a newer transaction started at a given node can have a higher transaction ID than an older transaction started at that same node. However, on a system-wide basis, a transaction ID does not imply anything about the relative start times of different transactions.
结果,必须提供某种方法来保证:只有在读取事务开始之前已经提交了创建记录版本的事务时,事务才可以读取该记录版本。在本发明中,用于确定要读取哪个记录版本的这样的方法是用于创建记录版本的事务的事务提交时间,而不是开始时间。事务ID不包含其提交时间,因此在每一个节点上的事务管理器原子基于实际提交操作来向每一个事务分配提交序列号。每一个事务节点以增大的序列来生成其提交序列号。如果来自给定节点的事务具有提交序列号467,则来自具有较低的提交序列号的节点的所有事务确信已经被提交。所有节点生成相同的提交序列号,因此解译该编号需要对应的节点的编号和标识。As a result, some method must be provided to ensure that a transaction can read a record version only if the transaction that created the record version has been committed before the reading transaction begins. In the present invention, such a method for determining which record version to read is the transaction commit time of the transaction that created the record version, rather than the start time. The transaction ID does not contain its commit time, so the transaction manager on each node atomically assigns a commit sequence number to each transaction based on the actual commit operation. Each transaction node generates its commit sequence number in an increasing sequence. If a transaction from a given node has a commit sequence number of 467, then all transactions from nodes with lower commit sequence numbers are guaranteed to have been committed. All nodes generate the same commit sequence number, so interpreting the number requires the number and identity of the corresponding node.
当事务提交时,其事务管理器原子向包括对应的事务ID和提交序列号的所有节点发送提交消息。当原子串行化其本身时,它包括它已经从拥有那个原子的副本的每一个节点看到的最高的提交序列号。例如,假定节点A、B和C包含原子Z的副本并且那个节点A生成用于原子Z的对象消息。那个消息的串行化形式将包括节点A已经从其本身看到的最高提交序列号和它已经从节点B和C看到的最高的提交序列号。来自节点A的串行化的消息描述了当节点A看到共享原子Y的副本的所有节点时在该所有节点上的事务的状态。有可能节点B或节点C可以实际上已经发出了用于节点A还没有接收或处理的事务的较高的提交序列号。When a transaction commits, its transaction manager atomically sends a commit message to all nodes that includes the corresponding transaction ID and commit sequence number. When an atom serializes itself, it includes the highest commit sequence number it has seen from each node that has a copy of that atom. For example, suppose nodes A, B, and C contain copies of atom Z and that node A generates an object message for atom Z. The serialized form of that message will include the highest commit sequence number that node A has seen from itself and the highest commit sequence number it has seen from nodes B and C. The serialized message from node A describes the state of the transaction on all nodes that share a copy of atom Y as node A sees it. It is possible that node B or node C may have actually issued a higher commit sequence number for a transaction that node A has not yet received or processed.
在每一个节点上的事务管理器在数据库系统中维持每一个节点的事务对象。每一个事务对象反映在所有节点上的事务的状态,并且向每一个对象分配局部的和连续的增大的两个或更多的编号。当事务管理器原子开始事务或接收到指示另一个节点已经开始事务的事务过渡消息时,事务管理器原子创建具有新的事务ID的局部事务对象,并且向其分配开始编号。当局部事务提交时或当事务管理器原子接收到指示已经提交了在另一个节点上的事务的事务过渡消息时,与提交序列号一起向事务对象分配事务结束编号。开始和结束编号来自同一序列。作为示例,如果事务123具有比事务453的结束编号高的开始编号,则事务123可以从执行事务453的任何节点读取由事务453创建的记录版本。The transaction manager on each node maintains a transaction object for each node in the database system. Each transaction object reflects the status of transactions on all nodes, and each object is assigned two or more local, sequentially increasing numbers. When the transaction manager atomically starts a transaction or receives a transaction transition message indicating that another node has started a transaction, the transaction manager atomically creates a local transaction object with a new transaction ID and assigns it a start number. When the local transaction commits or when the transaction manager atomically receives a transaction transition message indicating that a transaction on another node has been committed, the transaction object is assigned a transaction end number along with the commit sequence number. The start and end numbers are from the same sequence. For example, if transaction 123 has a higher start number than the end number of transaction 453, transaction 123 can read the record version created by transaction 453 from any node executing transaction 453.
事务开始和结束编号是局部的;也就是,它们反映如在局部节点上看到的事务的状态。不同的节点分配不同的值,并且看到在其他节点上的事务的不同排序。如将显而易见的,可以在接收中和在处理事务状态消息中存在延迟。每一个事务仅在其局部的事务节点上运行。这个数据库系统防止一个事务节点“看到”如在事务在其局部事务节点上提交之前提交的事务。例如,如果节点A在从用于事务453的事务节点B接收和处理提交消息之后开始事务123,则事务123可以从事务453读取改变,即使接收到事务的事务节点C以另一个顺序提交和开始消息并且将两个事务看作同时期的。Transaction start and end numbers are local; that is, they reflect the state of the transaction as seen on the local node. Different nodes assign different values and see different orderings of transactions on other nodes. As will be apparent, there can be delays in receiving and processing transaction status messages. Each transaction runs only on its local transaction node. This database system prevents a transaction node from "seeing" a transaction as committed before it commits on its local transaction node. For example, if node A begins transaction 123 after receiving and processing the commit message from transaction node B for transaction 453, transaction 123 can read changes from transaction 453, even if transaction node C, which received the commit and begin messages for the transactions in another order, sees the two transactions as contemporaneous.
当没有事务在事务节点C上运行时,信息不与事务节点C相关。然而,在每一个单独事务节点的数据库系统的视图之间的差在特定情况下可能引起问题。When no transaction is running on transaction node C, the information is not relevant to transaction node C. However, the difference between the views of the database system at each individual transaction node may cause problems in certain situations.
相对于“原子偏斜”,根据本发明的一个方面,每一个节点必须以另一个节点发送消息的顺序来处理来自该另一个节点的消息。然而,所有节点独立地操作。因此,在任何给定的时间,一些节点将已经接收和处理了其他节点还没有处理的消息。原子的一些副本将包括其他副本没有的改变。那些差别不影响具有副本的任何节点,因为原子的每一个副本处于那个节点的一致状态中。如前所述,每当事务节点改变原子时,该节点向包含那个原子的副本的所有其他节点复制改变的原子。如果事务节点B和C每一个包含那个原子的副本并且事务节点B改变那个原子,则事务节点B向事务节点C发送复制消息。在事务节点B正处理事务的同时,它向事务节点C发送事务状态消息,并且复制事务节点B改变的任何原子。当事务节点B通过在图23中所示的处理来提交事务时,事务节点C应当已经接收到用于指示已经提交了事务的事务状态消息。事务节点C将处理与事务相关的所有消息,然后它因为下述情况而接收提交消息:所有的消息将以它们被发送的顺序被处理。在不同的事务节点上的原子的副本可以不同,但是由在任何事务节点上的事务进行的所有改变将在每一个其他节点上,然后该其他节点将该事务看作被提交。In contrast to "atom skew," according to one aspect of the present invention, each node must process messages from another node in the order in which it sent the messages. However, all nodes operate independently. Therefore, at any given time, some nodes will have already received and processed messages that other nodes have not yet processed. Some copies of atoms will include changes that other copies do not. These differences do not affect any node with a copy, because each copy of the atom is in a consistent state with that node. As previously described, whenever a transaction node changes an atom, it replicates the changed atom to all other nodes that contain a copy of that atom. If transaction nodes B and C each contain a copy of that atom, and transaction node B changes that atom, transaction node B sends a replication message to transaction node C. While transaction node B is processing the transaction, it sends a transaction status message to transaction node C, replicating any atoms that transaction node B changed. When transaction node B commits the transaction through the process shown in Figure 23, transaction node C should have received the transaction status message indicating that the transaction has been committed. Transaction node C will process all messages related to the transaction, and then it will receive a commit message because all messages will be processed in the order in which they were sent. The copies of the atoms on different transaction nodes may be different, but all changes made by a transaction on any transaction node will be on every other node, which then sees the transaction as committed.
当观看来自系统级的事务时,不同的事务节点不同步地行动。单个消息正被不同节点处理的时间可以因为在通信路径的效率和每一个事务节点需要处理的消息的数量上的差别而变化。必须考虑在不同节点处的处理时间上的差别。考虑三个事务节点:节点A、节点B和节点C。假定节点B执行改变原子X的事务768并且节点C具有原子X的副本。假定在节点B处的原子X向节点C发送改变消息,并且在节点C处理那些改变之前有一些时间过去。也假定节点B已经向事务768分配了提交序列号47。在节点B上的事务管理器原子向在数据库系统中的所有节点发送事务状态消息。也假定节点A在从节点B接收到提交消息之后但是在节点C完成处理事务之前从节点C请求原子X的副本。节点A从节点B接收和处理事务状态消息。从节点A的视角看,事务768被提交,并且用于节点B的最高提交序列号是47。然而,对于这个定时,从节点C返回的原子不反映由节点B处的事务作出的改变。When viewing transactions from a system-level perspective, different transaction nodes act asynchronously. The time it takes for a single message to be processed by different nodes can vary due to differences in the efficiency of communication paths and the number of messages each transaction node needs to process. Differences in processing time at different nodes must be accounted for. Consider three transaction nodes: Node A, Node B, and Node C. Assume that Node B executes transaction 768, which changes Atom X, and Node C has a copy of Atom X. Assume that Atom X at Node B sends a change message to Node C, and some time passes before Node C processes those changes. Assume also that Node B has assigned a commit sequence number of 47 to transaction 768. The transaction manager on Node B atomically sends a transaction status message to all nodes in the database system. Assume also that Node A requests a copy of Atom X from Node C after receiving the commit message from Node B but before Node C has finished processing the transaction. Node A receives and processes the transaction status message from Node B. From Node A's perspective, transaction 768 is committed, and the highest commit sequence number for Node B is 47. However, for this timing, the atom returned from node C does not reflect the changes made by the transaction at node B.
根据本发明,当在节点C上的原子X串行化其本身以发送到节点A时,它包括来自具有原子X的副本的每一个节点的最高提交序列号。在该情况下,假定消息将包括用于节点C的提交序列号97和用于节点B的提交序列号46。According to the present invention, when atom X on node C serializes itself to send to node A, it includes the highest commit sequence number from every node that has a copy of atom X. In this case, it is assumed that the message will include commit sequence number 97 for node C and commit sequence number 46 for node B.
参见图22,作为请求节点的节点A创建了原子X的空实例,然后向节点C请求其内容。在图22中的访问性分析获得如节点A看到的每一个节点的当前最高提交序列号。它也用原子X来扩展串行化的消息,以获得如节点B看到的每一个节点的当前最高提交序列号。在这个比较中,访问性分析将确定在消息中的串行化的提交序列号是46,而用于B的其局部最高提交序列号是47。因此,节点B不能使用在其当前状态中的原子X的串行化版本,并且必须等待在节点C上的原子X以向其发送对象完成消息。如果提交序列号是相同或更大的,则节点A可以继续处理原子。Referring to Figure 22, node A, acting as a requesting node, creates an empty instance of Atom X and then requests its contents from node C. The accessibility analysis in Figure 22 obtains the current highest committed sequence number for each node as seen by node A. It also extends the serialized message with Atom X to obtain the current highest committed sequence number for each node as seen by node B. In this comparison, the accessibility analysis will determine that the serialized commit sequence number in the message is 46, while its local highest commit sequence number for B is 47. Therefore, node B cannot use the serialized version of Atom X in its current state and must wait for Atom X on node C to send it an object completion message. If the commit sequence numbers are the same or greater, node A can continue processing the atom.
如前所述,当节点C向节点A发送原子X的串行化副本时,它发送针对原子X的其他副本的对象可用消息,在该情况下是针对节点B上的副本的对象可用消息。在节点B上的原子X向在节点C上的原子X发送对象确认消息,并且向其本身的副本列表添加在节点A上的副本。其后,在节点B上的原子X将发送针对两个节点A和C上的其副本的改变消息。同时,在节点C上的原子X处理来自节点B的消息,将它们中继到节点A。在节点A上的原子X处理消息,使得其本身越来越最新。当在节点C上的原子X处理来自在节点B上的原子X和在其他节点上的原子X的所有其他副本的对象确认消息时,它发送针对在节点A上的原子X的对象完成消息。As previously described, when Node C sends a serialized copy of Atom X to Node A, it sends Object Available messages for the other replicas of Atom X, in this case, the replica on Node B. Atom X on Node B sends an Object Confirmation message to Atom X on Node C and adds the replica on Node A to its own replica list. Thereafter, Atom X on Node B sends Change messages for its replicas on both Nodes A and C. Simultaneously, Atom X on Node C processes messages from Node B, relaying them to Node A. Atom X on Node A processes the messages, making itself increasingly up-to-date. When Atom X on Node C processes Object Confirmation messages from Atom X on Node B and all other replicas of Atom X on other nodes, it sends an Object Completed message for Atom X on Node A.
根据本发明,每一个事务节点应当操作而不必向盘或其他永久存储器传送任何原子。这要求以迅速的方式从每一个事务节点去除不活动的原子。未了实现这个目标,在每一个节点中的助手类定期地提供由循环管理器调用的垃圾收集功能,以独立于其他操作而启动新的垃圾收集循环。更具体地,循环管理器执行老化循环,据此,在前一个循环中参考的任何原子被移动到在用于那个节点的主目录原子中的最近最少使用(LRU)列表上的前面。循环管理器获得排他锁定,以保证没有其他的线程相对于前一个循环是活动的。According to the present invention, each transaction node should operate without having to transfer any atoms to disk or other permanent storage. This requires that inactive atoms be removed from each transaction node in a rapid manner. To achieve this goal, a helper class in each node periodically provides garbage collection functionality that is called by the cycle manager to initiate new garbage collection cycles independently of other operations. More specifically, the cycle manager performs an aging cycle whereby any atoms referenced in the previous cycle are moved to the front of the least recently used (LRU) list in the master directory atoms for that node. The cycle manager obtains an exclusive lock to ensure that no other threads are active with respect to the previous cycle.
循环管理器然后开始用于对于记录垃圾收集标记的表格原子的记录垃圾收集线程。如果在节点处的存储器的当前量超过由在图5处的指针70U识别的配置对象限定的指定量,则垃圾收集线程处理通过主目录LRU从最近最少使用到最近最多使用的原子进行循环。如果那个原子(1)不活动,(2)已经在当前的老化循环中被参考,(3)不是“对象不完成”原子,(4)已经被局部改变并且还没有被写入档案节点,并且(5)是没有存储器驻留原子的目录,则它将原子分类为垃圾收集候选者的候选者。在档案节点中的原子另外必须还没有被串行化到盘。The cycle manager then starts a record garbage collection thread for the table atoms that were marked for record garbage collection. If the current amount of memory at the node exceeds the specified amount defined by the configuration object identified by pointer 70U at Figure 5, the garbage collection thread processes the atoms in the cycle from least recently used to most recently used through the main directory LRU. It classifies an atom as a candidate for garbage collection if that atom (1) is not active, (2) has been referenced in the current aging cycle, (3) is not an "object not complete" atom, (4) has been changed locally and has not yet been written to the archive node, and (5) is a directory with no memory resident atoms. The atom in the archive node must also not have been serialized to disk.
如果垃圾收集处理确定已经满足了所有前述的条件,则存在两个选项。如果节点是档案节点并且存在在其他节点处的原子的其他实例,则原子的内容被“清除”。否则,请求原子丢弃其本身,它通过首先查看其创建的目录原子以进行最后测试来如此进行。如果通过那个测试,则目录原子清除指向向包含候选原子的实例的其他节点广播对象不可用消息的候选原子的其指针,然后删除其本身。这个循环逐个原子地继续,直到工作存储器在可接受的限度内。If the garbage collection process determines that all of the foregoing conditions have been met, there are two options. If the node is an archive node and there are other instances of the atom at other nodes, the contents of the atom are "cleared". Otherwise, the requesting atom discards itself, which it does by first looking at the directory atom it created for a final test. If that test is passed, the directory atom clears its pointer to the candidate atom, broadcasts an object unavailable message to other nodes containing instances of the candidate atom, and then deletes itself. This cycle continues, atom by atom, until working memory is within acceptable limits.
两种机制涉及这个处理。当请求目录原子找到用于分类的原子时,目录原子将其循环参考条目设置为当前循环编号。另外,事务管理器、数据库、图式、序列和表格原子在当前循环上获得共享锁定,使得在那些原子中的方法可以持有原子指针,而不必递增原子使用计数,以防止对象或原子被垃圾收集。Two mechanisms are involved in this process. When a requesting directory atom finds an atom for classification, the directory atom sets its cycle reference entry to the current cycle number. Additionally, the transaction manager, database, schema, sequence, and table atoms acquire a shared lock on the current cycle so that methods in those atoms can hold onto the atom pointer without having to increment the atom usage count to prevent the object or atom from being garbage collected.
图19和20描述了“主席身份”。如图20中所示,当创建原子时,将创建的节点指定为原子主席,并且建立用于该原子的节点的有序列表。当节点创建原子时,它是在有序列表中的仅有的条目。在列表中的第一节点是主席。Figures 19 and 20 describe "chairpersonship." As shown in Figure 20, when an atom is created, the created node is designated as the atom chairperson, and an ordered list of nodes for that atom is established. When a node creates an atom, it is the only entry in the ordered list. The first node in the list is the chairperson.
当另一个节点后来请求那个原子的副本时,所选择的节点将请求节点的标识布置在该有序列表中刚好在其本身之后,而不论它是否是主席。结果,如果被指定为用于任何原子的主席的节点因为任何原因而变得不活动,则那个原子的每一个其他副本具有节点的有序列表。通过该有序列表,下一个主席是在列表上的第一剩余事务节点。如果在列表上没有事务节点,则指定第一非同步档案节点。When another node later requests a copy of that atom, the selected node places the requesting node's identifier just after itself in the ordered list, regardless of whether it is the chairperson. Consequently, if the node designated as chairperson for any atom becomes inactive for any reason, every other copy of that atom has an ordered list of nodes. Using this ordered list, the next chairperson is the first remaining transaction node on the list. If there are no transaction nodes on the list, the first unsynchronized archive node is designated.
讨论简单的数据库查询现在可能对于帮助理解在不同节点和节点内的原子之间的交互是有用的。假定在事务节点处的数据库请求引擎接收到数据库查询以选择在具有邮政编码“01944”的表格“成员”中的所有记录。假定事务管理器原子和表格原子位于局部节点处,已经完成了所有的查询处理,并且对于在“成员”表格中的“邮政编码”字段存在索引原子。It may now be useful to discuss a simple database query to help understand the interactions between different nodes and atoms within the nodes. Assume that the database request engine at the transaction node receives a database query to select all records in the table "members" that have the zip code "01944." Assume that the transaction manager atom and the table atom are located at the local node, that all query processing has already completed, and that an index atom exists for the "zipcode" field in the "members" table.
初始,在图2中的数据库请求引擎41向事务管理器发出命令以开始新的事务,此时,事务管理器原子分配事务ID。接下来,数据库请求引擎利用用于“成员”表格的表格原子来确定是否对于“邮政编码”字段存在索引原子。如果这两个原子在局部节点处,则它们被处理。如果它们不在局部节点处,则从其他节点获得这些原子的副本,然后处理继续。Initially, the database request engine 41 in FIG2 issues a command to the transaction manager to begin a new transaction. At this point, the transaction manager atomically assigns a transaction ID. Next, the database request engine uses the table atom for the "Member" table to determine whether an index atom exists for the "ZipCode" field. If both atoms are present at the local node, they are processed. If not, copies of these atoms are obtained from other nodes, and processing continues.
用于“成员”表格的表格原子利用来自对应的表格目录原子的信息来扫描索引。这产生了位图,该位图识别在具有指定的邮政编码的“成员”表格中的每一个“记录”。如将显而易见的,这个位图可以限于特定字段或可以是来自多个字段的索引的逻辑组合的结果。The table atom for the "Members" table scans the index using information from the corresponding table directory atom. This produces a bitmap that identifies every "record" in the "Members" table that has a specified postal code. As will be apparent, this bitmap can be limited to a specific field or can be the result of a logical combination of indexes from multiple fields.
接下来,基于所得到的位图来建立循环。对于该循环的每一次迭代,数据库请求引擎向表格原子发出调用,以处理用在记录中的事务ID指定的获取记录方法。表格原子通过下述方式选择与记录原子相关的适当的记录状态原子:将记录编号除以与记录状态原子管理的记录ID的最大数对应的固定数。接下来,表格原子使用事务ID和识别的记录编号来在所选择的记录状态原子中使用获取方法。对于多版本记录,记录状态原子循环通过任何记录版本,以找到正确的版本和指向对应的数据原子的适当指针。记录状态原子用指向记录的数据原子编号来调用那个数据原子,并且允许其检索。当完成这个处理时,数据库请求引擎向用户提供列出了具有指定的邮政编码的所有记录的记录集。Next, a loop is established based on the resulting bitmap. For each iteration of the loop, the database request engine issues a call to the table atom to process the get record method specified by the transaction ID in the record. The table atom selects the appropriate record status atom associated with the record atom by dividing the record number by a fixed number corresponding to the maximum number of record IDs managed by the record status atom. Next, the table atom uses the transaction ID and the identified record number to use the get method in the selected record status atom. For multi-version records, the record status atom loops through any record versions to find the correct version and the appropriate pointer to the corresponding data atom. The record status atom calls that data atom with the data atom number pointing to the record and allows it to be retrieved. When this processing is completed, the database request engine provides the user with a record set that lists all records with the specified postal code.
总之,对于本领域内的普通技术人员将显而易见的是,根据本发明构造的数据库管理系统提供了弹性的、可扩展的按需分布的数据处理系统。该系统是容错的,并且具有高度的可用性。它是独立于平台的,并且操作成提供弹性的、一致的、隔离和耐久的数据库。而且,它可以在因特网上操作,而不需要高速通信路径,并且适于可以在宽的地理区域上实现的事务处理。In summary, it will be apparent to those skilled in the art that a database management system constructed in accordance with the present invention provides a resilient, scalable, on-demand distributed data processing system. The system is fault-tolerant and highly available. It is platform-independent and operates to provide a resilient, consistent, isolated, and durable database. Furthermore, it can operate over the Internet without requiring high-speed communication paths and is suitable for transaction processing that can be implemented over a wide geographic area.
本发明通过实现下面的特征的一个或多个来实现所有这些目的。本发明将数据库划分为在对等基础上复制的分布式对象。每一个事务和档案节点确定哪些原子要在局部的基础上驻留在存储器上。目录原子跟踪到各个原子的局部和远程副本的位置,并且识别它们是其成员的目录。而且,每一个节点可以确定多个节点的最佳者,从该最佳者请求启用地理上分散的系统的原子的副本。The present invention achieves all of these objectives by implementing one or more of the following features. The present invention partitions a database into distributed objects that are replicated on a peer-to-peer basis. Each transaction and archive node determines which atoms to reside in memory on a local basis. Directory atoms track the location of local and remote replicas of each atom and identify the directories of which they are members. Furthermore, each node can determine the best of multiple nodes from which to request replicas of atoms for a geographically distributed system.
已经以特定的实施例公开了本发明。将显而易见的是,在不偏离本发明的情况下可以对于所公开的设备进行许多修改。因此,所附的权利要求的意愿是覆盖在本发明的真实精神和范围内的所有这样的变化和修改。The present invention has been disclosed in terms of specific embodiments. It will be apparent that many modifications may be made to the disclosed apparatus without departing from the invention. It is therefore intended that the appended claims cover all such changes and modifications as come within the true spirit and scope of the invention.
Claims (35)
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US61/315,351 | 2010-03-18 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| HK1228057A1 HK1228057A1 (en) | 2017-10-27 |
| HK1228057B true HK1228057B (en) | 2021-02-19 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105956176B (en) | database management system | |
| US5991771A (en) | Transaction synchronization in a disconnectable computer and network | |
| CN112236758B (en) | Cloud storage distributed file system | |
| US5878434A (en) | Transaction clash management in a disconnectable computer and network | |
| US6192365B1 (en) | Transaction log management in a disconnectable computer and network | |
| JP7220807B2 (en) | Data reading method, device, computer device and computer program | |
| US11599514B1 (en) | Transactional version sets | |
| US11709809B1 (en) | Tree-based approach for transactionally consistent version sets | |
| EP1840768A2 (en) | Systems and method for a distributed in-memory database | |
| US20030200212A1 (en) | Method, system, and program product for transaction management in a distributed content management application | |
| HK1228057B (en) | Database management system | |
| Bhargava et al. | Design and implementation of the Raid V2 distributed database system | |
| CA2227430C (en) | Transaction clash management in a disconnectable computer and network | |
| HK1228057A1 (en) | Database management system | |
| CN119513082A (en) | Data processing method, electronic device and storage medium | |
| WO2025020531A1 (en) | Index creation method and apparatus in distributed system | |
| CN120215810A (en) | A data processing method, device and distributed storage system |