Changes for page eMagiz State Generation
Last modified by Erik Bakker on 2024/08/13 12:05
From version 3.2
edited by Erik Bakker
on 2022/06/13 14:05
on 2022/06/13 14:05
Change comment:
Update document after refactoring.
To version 8.1
edited by Carlijn Kokkeler
on 2023/07/07 13:42
on 2023/07/07 13:42
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - fundamental-stateful1 +eMagiz State Generation - 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,21 @@ 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 +TBenefits 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 -The example are purely illustrative to understand the concept. 30 - 31 -==== 3.1 State Store ==== 32 - 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. 34 - 26 +[[image:Main.Images.Fundamental.WebHome@fundamental-stategeneration-example-enrich.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]]61 +[[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