Changes for page eMagiz State Generation
Last modified by Erik Bakker on 2024/08/13 12:05
To version 10.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,0 +1,1 @@ 1 +eMagiz State Generation - Parent
-
... ... @@ -1,0 +1,1 @@ 1 +WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ebakker1 +XWiki.CarlijnKokkeler - Content
-
... ... @@ -1,9 +1,4 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - 3 - 4 - 5 -= eMagiz Stateful = 6 - 7 7 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. 8 8 9 9 Should you have any questions, please get in touch with academy@emagiz.com. ... ... @@ -14,24 +14,33 @@ 14 14 15 15 == 2. Key concepts == 16 16 17 - All conceptsare discussedin the section below..12 +In this microlearning, the concept of state generation will be explained. 18 18 14 +== 3. Definition == 19 19 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. 20 20 21 - ==3.IntroducingStateful==18 +An example 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 in this example, after which the data needs to be put into context, including the time at which a certain temperature was measured and the room in which it was measured. Then, the data can be evaluated over time, and tested against the norm. This ensures that real time actions can be generated, e.g. a fire alert can be generated when the temperature has risen by 25 degrees Celsius in 1 minute. 22 22 23 - WithineMagizthere is a capability to store pieces of data of a specific object that is transit between systems. The basis idea ofmessages that are processed by eMagiz isthat all of theseare intransit. However, in certain cases it is very helpful to preserve a state of an object. That state can help to influence the nextdatapackets that are passingthrough or trigger a certain actionfor anothersystem.20 +== 4. Benefits and Operations == 24 24 25 - Anxample mightbe asituationwheresensor is submitting temperaturedata every 5seconds on a datastreamtowards eMagiz. Theinterestingstateofthe machine wherethesensorisattachedto is theaveragetemperaturein the lasthour. In thiscasethetemperature thatis sendto theeMagiz shouldbeusedto updatethe state of the machine, andmore specifically theaveragetemperature.Oneeedsa datastreamfrom thesensor,a waytoaggregate &averageoutallmessagesfrom the lasthour,and away to storethe state. Once the temperaturereachesa certainthreshold, thedataissubmitted toanext systemtoraise an alertfor a user.22 +Benefits of real time state generation are, first of all, that data can be provided immediately and is always up-to-date. Secondly, it is possible to take real time action and take real-time decisions. Lastly, there is no need to store data unnecessarily. 26 26 27 - Another example mightbeadatastreamthat registersa clickonaspecificwebpage. Thatdatastreams connectedto eMagiz,wherebythestateofthatspecificwebpage isupdatedwiththenumberofclicks. Oncethenumberof clicks in the last30 minutesreachesfor instancemorethan 50,a specificactionmightbe triggered. Ifthatpagecontainsa product,theactionmightbetoisplaythenumberofwebusersactiveon thatproduct inordertoinfluence thesalesof that product.One needs a datatream,awaytocountthe number ofclick,andawaytostorethe stateofthatwebpage.24 +Stateful data can be generated through four main operations. First of all, through enriching data. This means that information should be added to the data, so that it has more meaning. This can be achieved by storing states in a database. For example, when it is known that, if a person works from home, this is stored as A, and if a person works in the office, this is stored as B, the data can be enriched with ‘Home’ and ‘Office’. To ensure this, a database should be present storing the connection between A and Home, and B and Office. 28 28 29 - Theexamplearepurely illustrativetorstandtheconcept.26 +[[image:Main.Images.Fundamental.WebHome@fundamental-stategeneration-example-enrich.png]] 30 30 31 - ====3.1StateStore====28 +Secondly, stateful data can be obtained through aggregating data. Aggregation concerns a computation over a certain range of 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. 32 32 33 - The state store refers to the storage location of the states of the specific objects in the environment. That storagelocation is part of the eMagiz platform, and embedded in the eMagiz runtimefor now.Theuserneeds to define what objects andtheattributes of that object are tobestored. Several differentobjectsandstates of theobjects canbebe defined & stored. A state store canbeshared acrossmultipleprocesses that arellowedtoupdate the state of anobject.30 +[[image:Main.Images.Fundamental.WebHome@fundamental-stategeneration-example-aggregation.png]] 34 34 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]] 35 35 ==== 3.2 State Operations ==== 36 36 37 37 Once the state store is defined, one needs different operations in order to update the state effectively. ... ... @@ -60,8 +60,6 @@ 60 60 61 61 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. 62 62 63 - 64 - 65 65 == 4. Key takeaways == 66 66 67 67 * Stateful refers to the concept of storing a state of an object ... ... @@ -68,10 +68,8 @@ 68 68 * 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) 69 69 * 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 70 70 71 -[[image:Main.Images.Fundamental.WebHome@f fundamental-stateful-1.png]]73 +[[image:Main.Images.Fundamental.WebHome@fundamental-stateful-1.png]] 72 72 73 - 74 - 75 75 == 5. Suggested Additional Readings == 76 76 77 77 N/A