Event management system and event management method

By flagging and skipping events that do not affect the latest state, the event management system reduces the processing load during replays, addressing the inefficiencies in traditional event sourcing systems and improving performance in high-traffic scenarios.

JP2025037541APending Publication Date: 2025-03-18HITACHI LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023144530
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Traditional event sourcing systems face high processing loads during writing operations due to the need to replay all accumulated events for each command, leading to inefficiencies especially in scenarios with frequent user interactions like e-commerce.

Method used

An event management system flags events that are not affected by the latest state and skips these flagged events during replay requests, reducing the processing load by optimizing the replay process.

Benefits of technology

This approach significantly reduces the processing time for replays in event management systems with event sourcing, enabling faster and more efficient handling of frequent user interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025037541000001_ABST
    Figure 2025037541000001_ABST
Patent Text Reader

Abstract

To reduce the processing time for replay in event management to which event sourcing has been applied.SOLUTION: An event management system to which event sourcing has been applied is configured to add a flag to each of one or more events when an event group (one or more events) written in an event store includes the one or more events that conform to a flag addition condition that there is no influence on the latest state. The event management system executes, in response to a request for replay, replay while skipping events with flags in the event group in the event store, and returns a result of the execution.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention generally relates to the technology of event management, and more particularly to event management to which event sourcing is applied. [Background technology]

[0002] As customer needs and the environment change, there is an increasing need to continuously improve applications, and the microservices architecture that is suitable for this is attracting attention. However, the conversion of applications to microservices leads to the decentralization of data.

[0003] Non-Patent Document 1 describes a data management method using event sourcing as a mechanism for reducing the impact on performance and security that occurs when data is distributed. In this method, replaying of accumulated events is required for writing, and every time writing is performed, all events accumulated at the time of writing are subject to replay. Therefore, the large processing load required for writing is an issue.

[0004] Non-Patent Document 2 describes a technique for excluding events that have side effects during replay (for example, an event that causes an email to be sent every time a replay is performed) from the targets of replay. [Prior art documents] [Non-patent literature]

[0005] [Non-Patent Document 1] Pedro RG Vasconcellos, et al., “Applying Event Sourcing in a ERP System: A Case Study”, 2018 XLIV Latin American Computer Conference (CLEI) [Non-Patent Document 2] Kacper Gunia, “Event Sourcing Patterns: Replay Side Effect Handling”, November 1, 2019 Summary of the Invention [Problem to be solved by the invention]

[0006] An example of a series of events in a business process is an event group (one or more events) for a single cart in e-commerce (electronic commerce), such as creating a cart, adding products to the cart, deleting products from the cart, confirming the status of the cart, and making a purchase. Hereinafter, a series of events for a single object such as a cart will be referred to as a "series of events."

[0007] In conventional event sourcing, when the system receives a command (write command), it replays the events accumulated in the event store (a database that accumulates events) and generates the latest state, then validates the content of the received command, issues a new event, and accumulates the newly issued event in the event store. In other words, replay is required every time a command is received (every time a write is made). This creates the problem of a heavy processing load for writing to the event store. For example, particularly in cases where multiple users frequently make and cancel purchases, such as e-commerce, a large number of events occur in a short period of time, and replay takes a long time. [Means for solving the problem]

[0008] An event management system to which event sourcing is applied assigns a flag to each of one or more events among a group of events (one or more events) written in an event store if the one or more events satisfy a flagging condition, which is a condition that the latest state is not affected. In response to a replay request, the event management system executes the replay by skipping the flagged events among the group of events in the event store, and returns the result of the execution. Effect of the Invention

[0009] It is possible to reduce the replay processing time in event management to which event sourcing is applied. [Brief description of the drawings]

[0010] [Figure 1] FIG. 2 is an architecture diagram of an application including the event management system of the first embodiment. [Diagram 2] FIG. 4 is a diagram showing an example of an event group in a writing database according to the first embodiment. [Diagram 3] FIG. 13 is a diagram showing a flag processing configuration according to the first embodiment. [Figure 4] FIG. 4 is a flowchart of flag processing in the first embodiment. [Diagram 5] FIG. 11 is a diagram showing an example of an event group to which a flag is added by the flag processing of the first embodiment. [Figure 6] FIG. 13 is a diagram showing a replay process configuration of the first embodiment. [Figure 7] FIG. 4 is a flow diagram of a replay process in the first embodiment. [Figure 8] FIG. 4 is a flow diagram of a time travel process in the first embodiment. [Figure 9] FIG. 11 is a diagram showing an example of an event group to which a flag is added by the flag processing of the first embodiment. [Figure 10] FIG. 2 is a diagram showing an example of the relationship between the functions and data shown in FIG. 1 and hardware. [Figure 11] FIG. 11 is a flow diagram showing a part of a time travel process in the second embodiment. [Figure 12]FIG. 11 is a flow diagram showing a part of a time travel process in the third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] In the following description, an "interface unit" may refer to one or more interface devices. The one or more interface devices may be at least one of the following: One or more I / O (Input / Output) interface devices. The I / O (Input / Output) interface devices are interface devices to at least one of the I / O devices and a remote display computer. The I / O interface device to the display computer may be a communications interface device. The at least one I / O device may be a user interface device, e.g., either an input device such as a keyboard and pointing device, or an output device such as a display device. One or more communication interface devices. The one or more communication interface devices may be one or more homogeneous communication interface devices (e.g., one or more NICs (Network Interface Cards)) or two or more heterogeneous communication interface devices (e.g., a NIC and an HBA (Host Bus Adapter)).

[0012] In the following description, a "memory" refers to one or more memory devices, which are an example of one or more storage devices, and may typically be a primary storage device. At least one memory device in the memory may be a volatile memory device or a non-volatile memory device.

[0013] In the following description, a "persistent storage device" may be one or more persistent storage devices, which are an example of one or more persistent storage devices. A persistent storage device may typically be a non-volatile storage device (e.g., an auxiliary storage device), and more specifically, may be, for example, a hard disk drive (HDD), a solid state drive (SSD), or a non-volatile memory express (NVMe) drive.

[0014] Furthermore, in the following description, a "processor" may be one or more processor devices. The at least one processor device may typically be a microprocessor device such as a CPU (Central Processing Unit), but may also be other types of processor devices such as a GPU (Graphics Processing Unit). The at least one processor device may be a single-core or multi-core. The at least one processor device may be a processor core. The at least one processor device may also be a processor device in a broader sense, such as a hardware circuit (e.g., an FPGA (Field-Programmable Gate Array), a CPLD (Complex Programmable Logic Device), or an ASIC (Application Specific Integrated Circuit)) that performs part or all of the processing.

[0015] In the following description, functions may be described using the expression "yyy unit", but the functions may be realized by one or more computer programs being executed by a processor, or by one or more hardware circuits (e.g., FPGA or ASIC), or by a combination thereof. When a function is realized by a program being executed by a processor, the function may be at least a part of the processor, since the specified processing is performed using a storage device and / or an interface device, etc., as appropriate. Processing described with a function as the subject may be processing performed by a processor or a device having the processor. A program may be installed from a program source. The program source may be, for example, a program distribution computer or a storage medium (e.g., a non-transitory storage medium) that can be read by a computer. The description of each function is an example, and multiple functions may be combined into one function, or one function may be divided into multiple functions.

[0016] In addition, in the following description, when describing elements of the same type without distinguishing between them, common reference symbols may be used, and when describing elements of the same type with distinction between them, reference symbols (or element identification numbers) may be used. EXAMPLES

[0017] The embodiment of the present invention will be described with reference to the drawings. The same symbols in the drawings indicate the same things. In the following description, the replay of events, particularly the replay of a series of past events at an intermediate point, may be referred to as "time travel."

[0018] FIG. 1 is a diagram showing the architecture of an application including an event management system according to the present embodiment.

[0019] The architecture in this embodiment is an architecture to which event sourcing and CQRS (Command Query Responsibility Segregation) are applied.

[0020] The user interface 101 is an interface that a user of an application such as e-commerce uses to send commands such as commands for performing a purchasing action and queries such as queries for viewing a purchase history to the application, and is configured as a Web application that provides the user with a set of functions. The user interface 101 may also include a display for displaying the Web application, and a mouse and a keyboard for operating the Web application. The user interface 101 sends a command that is a write command to the command processing unit 102, and receives the result from the command processing unit 102. The user interface 101 also sends a query that is a read command to the query processing unit 108, and receives the result from the query processing unit 108.

[0021] The command processing unit 102 receives a command from the user interface 101 and requests the replay processing unit 1032 of the event management system 103 to replay the events accumulated in the writing database 1033. The command processing unit 102 performs command processing according to the domain, such as E-commerce, based on the replay result, and transmits the result to the user interface 101 and also transmits a domain event to the event management system 103. For example, in E-commerce, when the command processing unit 102 receives a command from the user interface 101 instructing "User 1 puts product A in cart", it obtains the latest inventory status by replay. The command processing unit 102 checks the latest inventory status, and if there is inventory, transmits a result of command processing success to the user interface 101, and if there is no inventory, transmits a result of command processing error to the user interface 101. Furthermore, when the command processing is successful, the command processing unit 102 transmits the domain event "User 1 puts product A in cart" to the event management system 103 to write the domain event to the writing database 1033.

[0022] The event management system 103 includes a flag processing unit 1031, a replay processing unit 1032, and a writing database 1033. When the event management system 103 receives a replay request from the command processing unit 102, the replay processing unit 1032 replays the stored events and transmits the results to the command processing unit 102. When the event management system 103 receives a domain event from the command processing unit 102, the flag processing unit 1031 stores the event in the writing database 1033. When a specific domain event is received, the flag processing unit 1031 assigns a flag to the specific event group in the writing database 1033, as will be described in detail later.

[0023] The flag processing unit 1031 holds a flag processing configuration 10311 , and assigns a flag to a specific event group stored in the write database 1033 in accordance with the settings of the configuration 10311 .

[0024] The replay processing unit 1032 holds a replay processing config 10321, and in response to a replay request, replays and / or time travels a group of events stored in the writing database 1033 according to the settings of the config 10321. The replay processing unit 1032 returns the results of the replay and / or time travel to the sender of the replay request (the command processing unit 102 in this embodiment). The replay request may specify an ID of a series of events to be replayed. In addition, in a replay performed in response to a replay request, the event serving as the start point may be the oldest event among the events (or the series of events to be replayed) stored in the writing database 1033, and the event serving as the finish point may be the latest event among the events (or the series of events to be replayed) stored in the writing database 1033. In time travel performed in response to a replay request, the starting event may be the oldest event among the events (or the series of events to be replayed) stored in the writing database 1033, and the finishing event may be the event at the specified time travel point among the events (or the series of events to be replayed) stored in the writing database 1033. Thus, the time travel point may be specified in the time travel replay request. The results returned to the sender of the replay request may include the latest state obtained by the replay and / or time travel (e.g., the state obtained as a result of replay or time travel for each series of events).

[0025] The write database 1033 is a database in which domain events received from the command processing unit 102 are stored. The database 1033 may be a dedicated event store or a general-purpose database.

[0026] Each time a domain event is written to the write database 1033 of the event management system 103, the change capture unit 104 grasps that a write has occurred and transmits the content of the write (the content that has been written) to the transmission unit 105 as a change event.

[0027] The transmission unit 105 transmits the change event received from the change capture unit 104 to the database update unit 106 .

[0028] When the database update unit 106 receives a change event from the transmission unit 105, it generates a state of the domain based on the contents of the change event and updates the read database 107 (reflecting the generated state in the read database 107).

[0029] The read database 107 is a database that stores the state of the domain received from the database update unit 106. The database 107 may be a general-purpose database.

[0030] The query processing unit 108 receives a query from the user interface 101, performs query processing according to a domain such as e-commerce, and transmits the result to the user interface 101. For example, in e-commerce, when the query processing unit 108 receives a query from the user interface 101 instructing “obtain purchase history”, the query processing unit 108 obtains corresponding data from the read database 107, converts the data into a format suitable for display on the user interface 101, and transmits the data with the converted format to the user interface 101.

[0031] As shown in FIG. 10, the command processing unit 102, the event management system 103, the change capture unit 104, the transmission unit 105, the database update unit 106, and the query processing unit 108 may be executed by a processor 133 of an information processing system 1000 as a physical computer system. Specifically, the information processing system 1000 has an interface device 131, a storage device 132, and a processor 133 connected thereto, and the processor 133 executes a computer program to realize functions such as the command processing unit 102, the event management system 103, the change capture unit 104, the transmission unit 105, the database update unit 106, and the query processing unit 108. The storage device 132 stores data such as a write database 1033, a read database 107, a replay processing configuration 10321, and a flag processing configuration 10311. These functions and data may be distributed among multiple different computers. For example, one or more computers having the event management system 103 and one or more computers having functions other than the event management system 103 may be provided.

[0032] FIG. 2 shows an example of a group of events in the writing database 1033 of this embodiment.

[0033] An event is added to the writing database 1033 for each object (e.g., cart), and events that have already been stored are not deleted. All events that have already been stored in the writing database 1033 are an event group 201, and the event group 201 includes an event for each object.

[0034] The event group 201 has information such as an event 211, a series of event IDs 212, an event No. 213, a time 214, and a flag 215 for each event (domain event).

[0035] Event 211 represents the content of a domain event, specifically, the content of an event generated by command processing unit 102, such as "User 1 created a cart" or "User 1 added product A to the cart."

[0036] The series of events ID 212 is an ID of a series of events, and is assigned by the flag processing unit 1031. In the example of the event group 201, the purchasing behavior of user 1 and the purchasing behavior of user 2 are each treated as separate series of events. That is, a series of events exists for each object, and in this example, the object is a user such as user 1 or user 2. As another example, the object may be a cart. The same series of events ID is assigned to each of one or more events for the same object.

[0037] The event No. 213 is a number assigned to each series of event ID in the order in which the events occurred (for example, a number indicating the order in which the events occurred), and the number is assigned by the flag processing unit 1031. Each event can be uniquely identified by the combination of the series of event ID and the event No.

[0038] The time 214 indicates the date and time when each event occurred, and the date and time is set by the flag processing unit 1031. The events are stored in chronological order.

[0039] The flag 215 is metadata that is assigned to each event, and is assigned by the flag processing unit 1031. The event group 201 shows an example in which no flag is assigned. In this embodiment, "no flag is assigned" means that the flag value is "f=0". On the other hand, "a flag is assigned" means that the flag value is "f=1". Therefore, "an event with a flag assigned" means an event with which "f=1" is associated.

[0040] FIG. 3 shows the flag processing configuration 10311 of this embodiment.

[0041] The flag processing unit 1031 determines the flag value of each event in the event group stored in the write database 1033 according to the contents of the flag processing configuration 10311. The flag processing configuration 10311 has information such as a start event 311, a target event 312, and a flag 313 for each flag processing.

[0042] The start event 311 represents a domain event such as "cart contents confirmed" or "cart canceled."

[0043] The target event 312 indicates the conditions for an event to be flagged among the events stored in the write database 1033. In the example of e-commerce, the target event is "an event in which the same product is added and deleted among the events having the same series of event ID as the series of event ID of the event for finalizing the contents of the cart."

[0044] Flag 313 indicates the value of the flag of an event that satisfies the condition indicated by target event 312 when the event indicated by start event 311 is detected. If flag 313 is "f=1", this means that a flag is added. If flag 313 is "f=0", this means that if a flag is added, the flag is deleted (the value of the flag associated with the event is set to "f=0").

[0045] The start event 311 and the target event 312 are defined for each domain, for example.

[0046] FIG. 4 is a flow diagram of the flag processing in this embodiment.

[0047] When the event management system 103 receives a domain event from the command processing unit 102, the flag processing unit 1031 starts flag processing.

[0048] The flag processing unit 1031 determines whether the received event corresponds to an event represented by any of the start events 311 specified in the flag processing configuration 10311 (step 401). If the received event does not correspond to any of the events represented by the start events 311, the flag processing unit 1031 ends the flag processing. If the received event corresponds to any of the events represented by the start events 311, the processing proceeds to step 402.

[0049] The flag processor 1031 acquires the series of event ID of the received event (the event represented by the start event 311 corresponding to YES in step 401) (step 402). The series of event ID has been set by the flag processor 1031 when the event is received.

[0050] The flag processing unit 1031 scans the events stored in the write database 1033, starting from the latest event, for the events having the same series of event ID as the series of event ID acquired in step 402, and associates the flag value represented by the flag 313 corresponding to the corresponding start event 311 with all events in the scanning range that meet the condition represented by the target event 312 corresponding to the corresponding start event 311 (step 403). In the example of the event group 201 shown in FIG. 2, the event "user 1 confirms the contents of the cart" is the start event, and the series of event ID is "XXX". The flag processing unit 1031 searches the event No. 213 for the series of event ID "XXX" backward from 005 to 001, extracts a combination of the event "user 1 adds product A to the cart" and the event "user 1 deletes product A from the cart" as target events, and assigns flags to those events.

[0051] FIG. 5 shows an example of a group of events to which flags have been added by the flag processing of this embodiment.

[0052] According to the event group 201 shown in FIG. 5, f=1 is assigned to some of the events in the event group 201 shown in FIG.

[0053] FIG. 6 shows the replay process configuration 10321 of this embodiment.

[0054] The replay processing unit 1032 executes replay and / or time travel for the events stored in the write database 1033 according to the contents of the replay processing configuration 10321. The flag processing is an example in which replay and / or time travel is executed while skipping the event according to the flag value. In this example, when the flag value is f=1, the event is skipped.

[0055] FIG. 7 is a flow diagram of the replay process of this embodiment.

[0056] When the event management system 103 receives a replay request from the command processing unit 102, the replay processing unit 1032 replays the stored events. In this example, replay, that is, the process of replaying the events in order from the oldest to the newest, will be described.

[0057] The replay processor 1032 determines whether the latest event is the last of a series of events (step 701). The last of a series of events is an event that satisfies the condition of being the last event of the series of events among events with the same series of events ID, and in e-commerce, for example, this corresponds to an event such as "User 1 confirms the contents of the cart."

[0058] If the latest event is the last of the series of events (step 701: YES), the replay processor 1032 performs replay while skipping events (step 702) in accordance with the replay processing configuration 10321. This can reduce the replay processing time.

[0059] If the latest event is not the last of the series of events, that is, if the series of events is not complete (step 701: NO), the replay processor 1032 performs replay while skipping events up to the last series of events of the completed series of events (one or more series of events) preceding the incomplete series of events in accordance with the replay process configuration 10321 (step 703). The replay processor 1032 performs replay without skipping events from the first event of the incomplete series of events to the latest event, because no flags have been set yet (step 704).

[0060] FIG. 8 is a flow diagram of the time travel process of this embodiment.

[0061] The event management system 103 receives a command to execute time travel from the user interface 101 via the command processing unit 102, and performs time travel of the events stored in the write database 1033 by the replay processing unit 1032. In this example, time travel, that is, processing for replaying the events in order from the oldest to an arbitrary time, will be described. Time travel is implemented in e-commerce, for example, to perform more precise inventory management by tracking not only the number of products that have been confirmed for purchase, but also the number of products in a cart.

[0062] The replay processing unit 1032 determines whether the event at the specified point (time) in time travel is the last of a series of events (step 801).

[0063] When the event at the specified time point of the time travel is the last of a series of events (step 801: YES), the replay processing unit 1032 performs replay while skipping events according to the replay processing configuration 10321 (step 802). This makes it possible to reduce the processing time of the time travel.

[0064] When the event at the specified time point of the time travel is not the last event of the series of events, that is, when the event is in the middle of the series of events (step 801: NO), the replay processing unit 1032 performs replay while skipping events according to the replay processing configuration 10321 until the end of the completed series of events before the incomplete series of events (step 803). In the explanation of FIG. 8, the "incomplete series of events" refers to a series of events that has a last event (that is, is a substantially completed series of events), but has an event at the specified time point of the time travel, and the event is not the last event. The replay processing unit 1032 ignores the flag and performs replay without skipping events from the first event of the incomplete series of events to the event at the specified time point of the time travel (step 804). If an event is skipped for a series of events included in an incomplete series of events, it may not be possible to reproduce the exact state, so it is necessary to perform time travel without skipping events regardless of the value of the flag.

[0065] According to the above embodiment, when replay and / or time travel is executed in event sourcing, it becomes possible to reduce processing time and reproduce an accurate state.

[0066] Although the above description has been given using an example in which a series of events does not occur in parallel, the same method can be applied to the case in which a series of events occurs in parallel, that is, to a series of events such as the event group 901 shown in Fig. 9. That is, the replay processing unit 1032 replays a series of events that are completed at the specified time point of time travel while skipping events in accordance with the replay processing configuration 10321, and replays a series of events that are not completed at that time point by ignoring the flag and without skipping events. EXAMPLES

[0067] A description will be given of the second embodiment. In this description, the differences from the first embodiment will be mainly described, and the description of the commonalities with the first embodiment will be omitted or simplified.

[0068] FIG. 11 is a flow diagram showing a part of the time travel process in the second embodiment.

[0069] After step 803 in FIG. 8, the flag processing unit 1031 performs step 403 in FIG. 4 on the series of events that are not completed (step 1101). Since the series of events that are not completed are once completed, the flag "f=1" is associated with the events that satisfy the target event 312. However, in step 1101, some events associated with the flag "f=1" may not satisfy the target event 312, and as a result, the flag may be changed to "f=0". For example, although "f=1" is associated with the event "user 1 adds product A to cart" and the subsequent event "user 1 deletes product A from cart", the flag of at least the event "user 1 adds product A to cart" that precedes the event at the specified time point of time is changed to "f=0" because the event at the specified time point of time is an event between those events.

[0070] After step 1101, the replay processing unit 1032 performs replay (step 1102) from the first event of the incomplete series of events to the event at the specified time point of time travel, skipping events in accordance with the replay processing configuration 10321. Since the flag value was correctly updated in step 1101, an accurate state can be reproduced even if events included in the incomplete series of events are skipped (while reducing the processing time of time travel). EXAMPLES

[0071] Example 3 will be described below. In this regard, differences from Examples 1 and 2 will be mainly described, and descriptions of commonalities with Examples 1 and 2 will be omitted or simplified.

[0072] FIG. 12 is a flow diagram showing a part of the time travel process in the third embodiment.

[0073] In the third embodiment, the replay processing unit 1032 determines whether to replay an incomplete series of events without skipping events as in the first embodiment, or to replay an incomplete series of events while skipping events according to the replay processing configuration 10321 after performing step 403 as in the second embodiment (step 1201). Specifically, for example, the replay processing unit 1032 determines whether the processing load of the replay without skip (first embodiment) is higher than that of the replay with skip (second embodiment). The processing load of the replay without skip may be, for example, a processing load calculated by the replay processing unit 1032 based on the number of events to be scanned in the incomplete series of events (events from the start event to the event at the specified time point of time travel) and the processing load per event. The processing load of the replay with skip may be, for example, a processing load calculated by the replay processing unit 1032 based on the number of events in the incomplete series of events, the processing load per event in step 403, and the processing load reduction amount expected based on the number of events to be scanned in the incomplete series of events. It is expected that the greater the number of events to be scanned, the greater the number of events to be skipped, so the "amount of processing load reduction" may tend to be large.

[0074] If the replay processing unit 1032 selects replay with skip (for example, if replay without skip has a higher processing load than replay with skip), step 1101 is carried out.

[0075] If the replay processor 1032 selects non-skip replay (eg, if the processing load of non-skip replay is the same as or lower than the processing load of skip replay), step 804 is performed.

[0076] Although several embodiments have been described above, these are merely examples for explaining the present invention, and the scope of the present invention is not limited to these embodiments. The present invention can be implemented in various other forms. For example, in at least one of the second and third embodiments, the use of the flag after the replacement in step 1101 may be temporary. For example, a second flag of the first flag 215 may be provided for each event. Steps 802 and 803 may be performed based on the value of the first flag 215, and the flag to be replaced in step 1101 after step 803 may be the second flag. When step 1102 is performed based on the value of the second flag, the value of the second flag may be reset by the flag processing unit 1031.

[0077] Furthermore, for example, the above description can be summarized as follows. The following summary may include supplementary explanations and explanations of modifications of the above description.

[0078] An event management system to which event sourcing is applied (for example, the event management system 103) has a flag processing unit (for example, the flag processing unit 1031) and a replay processing unit (for example, the replay processing unit 1032). The flag processing unit 1031 assigns a flag to each of one or more events that meet a flagging condition (for example, the condition represented by the target event 312), which is a condition that the latest state is not affected, among an event group (for example, the event group 201), which is one or more events written in an event store (for example, the write database 1033). In response to a replay request, the replay processing unit skips the event to which the flag is assigned among the events in the event store, executes replay, and returns the execution result (returns to the sender of the replay request). This makes it possible to speed up replay in event management to which event sourcing is applied. Note that replay may be performed in a different case (for example, a case where a replay request occurs to confirm the state at a time specified by the user) instead of or in addition to being performed in a case such as the first embodiment, that is, when an event is written according to a command. Flagging may also be performed when a predetermined start condition (eg, the condition represented by the start event 311) is detected to be met (eg, when the last event of a series of events is written).

[0079] The group of events may include at least one of a series of events that is completed and a series of events that is not completed.

[0080] A completed series of events may be a series of events in which the last event scanned in the replay is the end event. For example, a completed series of events may be a series of events in which all events from the start event to the end event are subject to scanning in the replay.

[0081] On the other hand, an incomplete series of events may be a series of events in which the last event scanned in the replay is an event before the end event. For example, an incomplete series of events may be a series of events in which there are one or more events including a start event, but there is no end event, and all or some of these events are the subject of scanning, or a series of events in which all events from the start event to the end event are included, but some of these events are the subject of scanning. In the latter series of events, the event at the specified time point of time travel is the subject of scanning.

[0082] The replay processor may execute a replay of a series of completed events by skipping flagged events, thereby reducing the processing time for replaying a series of completed events.

[0083] The replay processing unit may execute replay without skipping events for an incomplete series of events even if a flag is attached (e.g., step 704 or 804). If all flagged events in all series of events are skipped, for example, a first event representing the addition of product A to a cart and a second event representing the removal of product A from the cart are each flagged, but if the last event scanned is an event after the first event and before the second event, the state that product A has been added to the cart cannot be reproduced. Therefore, if events for an incomplete series of events are replayed without skipping events even if a flag is attached, it is possible to reproduce the accurate state for each of all series of events, and the replay processing time for completed series of events can be reduced.

[0084] When an incomplete series of events is to be replayed, if there are one or more events in the incomplete series of events that meet the flagging condition, the flag processing unit may flag each of the one or more events (e.g., step 1101 in FIG. 11), and the replay processing unit may execute replay of the incomplete series of events by skipping the flagged events (e.g., step 1102). This makes it possible to replay the accurate state of the incomplete series of events, and is expected to reduce the replay processing time.

[0085] When an incomplete series of events is to be replayed, the replay processing unit may determine whether or not the processing load of a non-skip replay is greater than the processing load of a skip replay for the incomplete series of events (e.g., step 1201). If the result of the determination is true, the flag processing unit may perform, for example, step 1101, and the replay processing unit may perform, for example, step 1102. On the other hand, if the result of the determination is false, the replay processing unit may execute, for example, step 704 or 804 for the incomplete series of events. This is expected to reduce the processing load as much as possible. [Explanation of symbols]

[0086] 101 User Interface 102 Command processing section 103 Event Management System 1031 Flag Processing Unit 10311 Flag Processing Config 1032 Replay processing unit 10321 Replay Processing Config 1033 Write Database 104 Change Capture Section 105 Transmitter 106 Database Update Department 107 Loading Database 108 Query Processing Unit 201, 901 Event Group

Claims

1. An event management system to which event sourcing is applied, a flag processing unit that assigns a flag to each of one or more events among a group of one or more events written in the event store if the one or more events satisfy a flag assignment condition that is a condition that the latest state is not affected; a replay processing unit that, in response to a replay request, executes a replay while skipping flagged events among the events in the event store, and returns a result of the execution; An event management system comprising:

2. the group of events includes at least one of a series of completed events and a series of incomplete events; the completed sequence of events is a sequence of events in which the last event scanned in the replay is an end event; the incomplete series of events is a series of events in which the last event scanned in the replay is an event prior to the end event; the replay processing unit executes a replay by skipping flagged events for the series of completed events; The event management system of claim 1 .

3. the replay processing unit executes a replay without skipping an event for the series of events that has not been completed even if a flag has been assigned to the event. The event management system of claim 2 .

4. If said incomplete sequence of events is eligible for replay, the flag processing unit, if there is one or more events in the series of incomplete events that meet the flagging condition, flags each of the one or more events; the replay processing unit executes a replay by skipping flagged events for the series of incomplete events; The event management system of claim 2 .

5. If said incomplete sequence of events is eligible for replay, the replay processing unit determines whether a processing load of a non-skip replay is greater than a processing load of a skip replay for the series of incomplete events; If the result of the determination is true, the flag processing unit, if there is one or more events in the series of incomplete events that meet the flagging condition, flags each of the one or more events; the replay processing unit executes the replay with skip, which is a replay in which a flagged event is skipped for the series of incomplete events; When the result of the determination is false, the replay processing unit executes a non-skip replay for the series of incomplete events, which is a replay in which an event is not skipped even if a flag is assigned. The event management system of claim 2 .

6. An event management method to which event sourcing is applied, comprising: If there are one or more events among a group of one or more events written to the event store that satisfy a flagging condition, which is a condition that the latest state is not affected, a flag is assigned to each of the one or more events; In response to the replay request, execute a replay while skipping flagged events from among the events in the event store, and return a result of the execution. The event management method is carried out by a computer.

7. If there are one or more events among a group of one or more events written to the event store that satisfy a flagging condition, which is a condition that the latest state is not affected, a flag is assigned to each of the one or more events; In response to the replay request, execute a replay while skipping flagged events from among the events in the event store, and return a result of the execution. A computer program product that causes a computer to execute an event management method to which event sourcing is applied, the computer program product comprising: