The present invention relates to Content Management Systems (CMSs), and more specifically, to a scalable parallel messaging process in a CMS.
In a CMS, it is often necessary to exchange event messages with one or more external systems when some particular action occurs, for example, when an item or a document is created. However, for inter-dependent events, this may result in various problems. Inter-dependent (transactional) events refer to events that are triggered and interrelated with each other to complete the whole transaction. The inter-dependent events must be processed in a sequential order to maintain event or data integrity. If the inter-dependent events were to be processed in parallel, a “race condition” could occur, which might violate the event integrity. As an example, a “delete” event might be processed before a “reindex” event.
One possible solution to this problem is to process inter-dependent events in sequential order, but as the skilled person realizes, this becomes a bottleneck in event processing and has a negative impact on the performance scalability of the overall event processing. Thus, there is a need for better techniques for exchanging event messages between a CMS and one or more external systems.
According to one embodiment of the present invention, techniques are described for event processing in a content management system. In response to determining that an inter-dependence exists between two or more events in the content management system, a same group event key is assigned to each inter-dependent event. All events having the same group event key are distributed to a same event processing node on a consistent hashing ring.
The details of one or more embodiments of the invention are set forth in the accompanying drawings and the description below. Other features and advantages of the invention will be apparent from the description and drawings, and from the claims.
Like reference symbols in the various drawings indicate like elements.
In general, the various embodiments of the invention provide techniques for determining whether or not inter-dependence between event messaging exists, by using a set of predefined rules. A unique event group key is assigned for each group of inter-dependent events. By searching for the event group key location on a consistent hashing ring, all inter-dependent events can be dispatched to the same processing node, where they are processed sequentially, so as to ensure event/data integrity. By using the same consistent hashing algorithm for all events, all the independent groups of inter-dependent events can be distributed onto different parallel processing nodes for better performance scalability. The events can be easily stored into an event table and then be pulled out for processing. Alternatively, in some embodiments, the events can be pushed into an event processor for processing.
In addition to the event group key, each event typically also includes an event identifier (event ID), an event process status, and a message body. This information is queued in an event table 110 for an event dispatcher 108.
A Rule-Base Analyzer 104 manages all pre-defined rules 102 on event-enabled item types. The rule-base analyzer 104 also queries the event dispatcher 108 about the status or utilization of any given event processor node 112, 114, 116. As will be described in further detail below, a system administrator can to adjust the scope of rules for node utilization, in order to balance the workload among the different event processor nodes 112, 114, 116.
In one embodiment, a pre-defined rule 102 is used to determine whether is any inter-dependence between events, but does not describe the details of such a discovered relationship. One example of such a pre-defined rule 102 is as follows:
The “Ring ID” in the above rule is a unique identifier for a consistent hashing ring in the CMS. “Nodes” represents the processor nodes that are available for event distribution through this rule in the hashing ring. By default, <ALL> is used to indicate all available nodes for the hashing ring. The “Event Relationship” field is used to identify the events that are inter-dependent. Here, an event is represented as a pair consisting of an item type name and an event type.
“Event attributes” are attributes that are common between various events. The attributes may have different names defined for different item types, but their values should be logically identical.
where FUNC1, FUNC2, FUNC3 are relationship functions that map attributes between different item types. For example, assume that item type A has a single attribute named ‘transcation_id’, and item type B has two attributes ‘shop_id’, ‘catalog’, ‘item_id’ and ‘timestamp’. Then, Transcation_ID=FUNC (shop_id′, ‘catalog’, ‘item_id’, ‘timestamp’)=‘shop_id’+‘catalog’+‘item_id’+‘timestamp’
If no common attributes exist between item types, then there is no relationship between the events in the CMS. Thus, as can be seen in the “Attribute Map 1” column of the event table 110 of
When an event (such as 1, A2, B, or C) occurs, the event subscription 106 retrieves the actual values of common attributes, and calls a hashing function to generate a unique event group key based on the value of the common attribute(s). This is schematically illustrated in
Event group key=Hash (Rule ID, FUNC1 (value 1, value 2));
The event type/item type pair belongs to one pre-defined rule only. Thus, by searching the hashing ring 118 for the processing node 112, 114, 116 associated with a particular event group key, the dispatcher 108 can deliver any inter-dependent events to the same processing node 112, 114, 116 in the hashing ring 118, at which processing node the events will be processed in sequential order. Events that have different event group keys are distributed through a consistent hash algorithm for parallel processing at different processing nodes 112, 114, 116.
In some embodiments, the workload of the processing nodes 112, 114, 116 can be balanced by a system administrator through event rule adjustment. For example, assume that there are three event processors: Node A 112, Node B 114, and Node C 116 and two item types, and that the hardware capacity of Node B 114 and Node C 116 is much more powerful than the hardware capacity of Node A 112. By monitoring a current status and/or utilization of the event processing nodes 112, 114, 116 that are tracked by the event dispatcher 108, a system administrator may observe, for example, that Node A 112 is overloaded, but that Node B 114 and Node C 116 are nearly at idle status. In order to balance the workload on the three event processing nodes 112, 114, 116, the system administrator can adjust in the rule 102 how the processor nodes 112, 114, 116 are chosen (e.g., ALL->Node B, C, which excludes Node A as a processing node) through the Rule-Based Analyzer 104. Thus, the workload on Node A 112 will be dynamically moved onto Node B 114 and Node C 116 for faster processing.
The event dispatcher 108 periodically searches the event 110 table and gets the candidates ready for event processing. For each event that is ready for processing, the event dispatcher 108 uses a consistent hashing algorithm to create the event group key. Based on the event group key, the processing node 112, 114, 116 of the event in the consistent hashing ring 118 can be determined and the event can be mapped to the corresponding event processing node 112, 114, 116. The available processing nodes are stored in a local database, to which the event dispatcher 108 can refer. If the event process node 112, 114, 116 is unavailable, the event dispatcher 108 ignores all events on this node and the ignored events wait for the next scan.
The other function of the event dispatcher 108 is to periodically examine the availability and resource utilization (CPU etc.) of the processing nodes 112, 114, 116. When a processing node 112, 114, 116 becomes unavailable, the event dispatcher 108 immediately stops assigning events to that node, but continues to check the availability of the node 112, 114, 116. If the node 112, 114, 116 is still unavailable after a given time limit the unavailable processing node 112, 114, 116 is removed from the consistent hashing ring 118 and all unprocessed events on the node are moved to a different processing node on the ring. If the node 112, 114, 116 becomes available within the given time limit, the event dispatcher 108 continues to push events to this node 112, 114, 116 in a new scan cycle. In the event that the process node is entirely gone (i.e., the processing node has even lost the event data), the event data is recovered from the event table 110. The time limit for when to consider a node being gone may vary based on, for example, the business purpose of the CMS. For example, if a node remains off-line for a day, then the node might be removed.
When a new processing node 112, 114, 116 is registered into the hashing ring 118, the event dispatcher 108 first marks the new processing node as ‘Pending’, which disallows any event processing by the new processing node. The event dispatcher 108 also determines what other processing nodes on the hashing ring 118 will be affected by the addition of the new node, and 108 stops pushing events to these affected processing nodes. All existing events on these affected nodes are moved to adjacent nodes, after processing of existing events on the adjacent nodes have been completed. Finally, the event dispatcher 108 enables the new node (available status) and re-maps all related events according the new hashing ring 118 in the next scan cycle.
The event processing nodes 112, 114, 116 serve as work unit for actual event processing, and always process all their designated events in sequential order. The event processor at each event processing node 112, 114, 116 pulls events from the event table 110 and updates the status of the events from “unprocessed” to “processed” in the event table 110, so that the event dispatcher 108 knows which events have been processed.
The event processors receive a heartbeat from the event dispatcher 108 and returns an “available” signal. If no heartbeat is received from the event dispatcher 108, the event processors immediately stop processing any events.
The present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention. The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.
The descriptions of the various embodiments of the present invention have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Number | Name | Date | Kind |
---|---|---|---|
6687700 | Cornelius et al. | Feb 2004 | B1 |
7360025 | O'Connell | Apr 2008 | B1 |
7509653 | Das et al. | Mar 2009 | B2 |
7519652 | Page | Apr 2009 | B2 |
8005006 | Niemczyk et al. | Aug 2011 | B2 |
8473786 | Morimura et al. | Jun 2013 | B2 |
20030014558 | Amamiya et al. | Jan 2003 | A1 |
20050243740 | Chen | Nov 2005 | A1 |
20090157684 | Andersen | Jun 2009 | A1 |
20090182610 | Palanisamy et al. | Jul 2009 | A1 |
20090210586 | Tanabe | Aug 2009 | A1 |
20090271412 | Lacapra | Oct 2009 | A1 |
20090316687 | Kruppa | Dec 2009 | A1 |
20100268808 | Chkodrov | Oct 2010 | A1 |
20100324948 | Kumar et al. | Dec 2010 | A1 |
20120271943 | Chen | Oct 2012 | A1 |
20120284221 | Shelton et al. | Nov 2012 | A1 |
20130173530 | Laron | Jul 2013 | A1 |
20140199977 | Kim et al. | Jul 2014 | A1 |
20140334739 | Umanesan | Nov 2014 | A1 |
20160028630 | Wells | Jan 2016 | A1 |
Entry |
---|
Dauwels et al.; “Quantifying Statistical Interdependence by Message Passing on Graphs—Part I: One Dimensional Point Processes”, Neural Computation, MIT Press, 21.8 (2009): 2203-2268, IEEE vol. 21, Issue 8, May 19, 2014, pp. 2152-2202. |
Dauwels et al.; “Quantifying Statistical Interdependence by Message Passing on Graphs—Part II: Multidimensional Point Processes”, Neural Computation, MIT Press, 21.8 (2009): 2203-2268, IEEE vol. 21, Issue 8, May 19, 2014, pp. 2203-2268. |
Qian et al.; “REIN: A Fast Event Matching Approach for Content-Based Publish/Subscribe Systems”, IEEE INFOCOM 2014, Proceedings IEEE Conference on Computer Communications, Apr. 27-May 2, 2014, pp. 2058-2066. |
Scuturici et al.; “Dependency Detection in Interval-Based Event Streams”, DANS 3rd Workshop on New Frontiers in Mining Complex Patterns (NFMCP 2014), in Conjunction With ECML-PKDD 2014, Sep. 2014, pp. 74-86. |
Xin et al.; “Detection for Conflicts of Dependencies in Advanced Transaction Models”, Database Engineering and Application Symposium, IDEA'05, 2005 IEEE 9th International Conference on, Jul. 25-27, 2005, 10 pp. |
List of IBM Patents or Patent Applications Treated as Related. |
Number | Date | Country | |
---|---|---|---|
20160266944 A1 | Sep 2016 | US |