Changes for page eMagiz State Generation
Last modified by Erik Bakker on 2024/08/13 12:05
From version 9.1
edited by Carlijn Kokkeler
on 2023/07/07 13:44
on 2023/07/07 13:44
Change comment:
There is no comment for this version
Summary
-
Page properties (4 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,0 @@ 1 -eMagiz State Generation - Parent
-
... ... @@ -1,1 +1,0 @@ 1 -WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. CarlijnKokkeler1 +XWiki.ebakker - Content
-
... ... @@ -1,4 +1,9 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 + 3 + 4 + 5 += eMagiz Stateful = 6 + 2 2 In this fundamental, we'll take a look at the capability of eMagiz around storing a state of a data packet of message send across the platform. 3 3 4 4 Should you have any questions, please get in touch with academy@emagiz.com. ... ... @@ -9,33 +9,24 @@ 9 9 10 10 == 2. Key concepts == 11 11 12 - In this microlearning,theconceptofstategenerationwillbeexplained.17 +All concepts are discussed in the section below.. 13 13 14 -== 3. Definition == 15 15 16 -State generation concerns the generation of a stateful application or service. This means that, for the application or service to function, data is stored and past states are used to derive information. Such a state may e.g. be a temperature or heartrate measure. Stateful applications or services are opposed to stateless applications or services, which do not require data to function and merely represent the current state. 17 17 18 - Anexample of a stateful application, is an application that obtains temperature measures in a room and presents a timeline of the temperature measures.A thermostat produces the temperature inhis example, afterwhich the data needs tobe put into context, including the time at which a certain temperature was measured and the room in whichit was measured. Then, the data can be evaluated over time, and tested againstthe norm. This ensures thatreal time actions can be generated, e.g. afire alert can be generated when the temperature has risen by 25 degrees Celsiusin 1 minute.21 +== 3. Introducing Stateful == 19 19 20 - ==4.Benefits andOperations==23 +Within eMagiz there is a capability to store pieces of data of a specific object that is transit between systems. The basis idea of messages that are processed by eMagiz is that all of these are in transit. However, in certain cases it is very helpful to preserve a state of an object. That state can help to influence the next data packets that are passing through or trigger a certain action for another system. 21 21 22 - TBenefitsofrealtime state generation are,first ofall,thatdatacanbeprovidedimmediatelyandis always up-to-date.Secondly,itispossible to take realtime actionandtakereal-timedecisions.Lastly, thereisno needto storedataunnecessarily.25 +An example might be a situation where a sensor is submitting temperature data every 5 seconds on a data stream towards eMagiz. The interesting state of the machine where the sensor is attached to is the average temperature in the last hour. In this case the temperature that is send to the eMagiz should be used to update the state of the machine, and more specifically the average temperature. One needs a data stream from the sensor, a way to aggregate & average out all messages from the last hour, and a way to store the state. Once the temperature reaches a certain threshold, the data is submitted to a next system to raise an alert for a user. 23 23 24 - Statefuldatacanbegenerated through four mainoperations.Firstofall,throughenrichingdata. This meansthatinformationshouldbeddedto thedata,so thatit hasmoremeaning.Thiscanbeachievedbystoringstates in adatabase.Forxample,whenitisknownthat,if a personworksfromhome,thisisstoredasA,andifapersonworksin theoffice,thisisstoredas B, thedatacanbeenrichedwith‘Home’and‘Office’.To ensurethis,a databaseshouldbepresentstoringtheconnectionbetweenAandHome,andBandOffice.27 +Another example might be a data stream that registers a click on a specific webpage. That data stream is connected to eMagiz, whereby the state of that specific webpage is updated with the number of clicks. Once the number of clicks in the last 30 minutes reaches for instance more than 50, a specific action might be triggered. If that page contains a product, the action might be to display the number of web users active on that product in order to influence the sales of that product. One needs a data stream, a way to count the number of click, and a way to store the state of that webpage. 25 25 26 - [[image:Main.Images.Fundamental.WebHome@fundamental-stategeneration-example-enrich.png]]29 +The example are purely illustrative to understand the concept. 27 27 28 - Secondly,stateful data can be obtained through aggregating data.Aggregation concernsacomputation overa certain rangeof time, such as an average,minimum or maximum. For example, when the number of people working from home, or working at the office is stored, the average number of people working at home or at the office during the past 30 minutes can be determined.31 +==== 3.1 State Store ==== 29 29 30 - [[image:Main.Images.Fundamental.WebHome@fundamental-stategeneration-example-aggregation.png]]33 +The state store refers to the storage location of the states of the specific objects in the environment. That storage location is part of the eMagiz platform, and embedded in the eMagiz runtime for now. The user needs to define what objects and the attributes of that object are to be stored. Several different objects and states of the objects can be be defined & stored. A state store can be shared across multiple processes that are allowed to update the state of an object. 31 31 32 -Thirdly, change detection can be applied. This means that a change in the data can be detected. For example, when the temperature at home rises to more than 30 degrees, this can be detected. It can then be defined that, when the temperature at home is more than 30 degrees and the heating is on, the heating should be turned off. In this example, the data is enriched with the last state of the air conditioning. 33 - 34 -[[image:Main.Images.Fundamental.WebHome@fundamental-stategeneration-example-change-detection.png]] 35 - 36 -Lastly, duplicate detection can be applied, meaning that duplicate data can be detected. For example, if the number of people working from home is recorded twice at a certain moment, this can be detected, and the data can be adapted accordingly. 37 - 38 -[[image:Main.Images.Fundamental.WebHome@fundamental-stategeneration-example-duplicate-detection.png]] 39 39 ==== 3.2 State Operations ==== 40 40 41 41 Once the state store is defined, one needs different operations in order to update the state effectively. ... ... @@ -64,6 +64,8 @@ 64 64 65 65 The state store is implemented inside the eMagiz runtime using the H2 database for now. For time related operations another technology is used (Esper), and the functionality is only available on Docker based runtimes (to be release end Q2 2022). You wil find the specific Stateful components inside the Flow Designer as we use in eMagiz to model the flow. Aligned with the general concept of low-code developnment in eMagiz. For State store models, the current data modeling capabilities will be used. 66 66 63 + 64 + 67 67 == 4. Key takeaways == 68 68 69 69 * Stateful refers to the concept of storing a state of an object ... ... @@ -70,8 +70,10 @@ 70 70 * Storing a state is different compared to data in transit which is often refered as stateless data (eMagiz doesn't store or update the data when sending across) 71 71 * Stateful can be applied across all patterns in eMagiz and is embedded into the platform in such a way that it provided the same user experience 72 72 73 -[[image:Main.Images.Fundamental.WebHome@fundamental-stateful-1.png]] 71 +[[image:Main.Images.Fundamental.WebHome@ffundamental-stateful-1.png]] 74 74 73 + 74 + 75 75 == 5. Suggested Additional Readings == 76 76 77 77 N/A