-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[epic] Distinguish between reported and desired state in twins #696
Comments
At least one corner case came to my mind: what happens if a property with a desired state gets deleted or renamed? Deletion, probably, is no problem because the desired state gets deleted as well. However when a property is renamed will its desired property renamed, too? If so, how does Ditto maintain the association of the former name to the new name for received state changes? |
I think that this is a cornercase which can only happen during development - once the model/structure of a feature is defined by a fixed "definition", there is no renaming of properties. When updating the major version of a definition (according to semantic versioning this would be the only way to rename a field), there would have to be a migration done anyways, so that migration must migrate properties as well as desired fields the same way. |
Problem statement
A feature which was long on the roadmap of Eclipse Ditto (see also former GH issue #125 where previous discussions were done) is the ability to distinguish between reported and desired twin state.
reported
twin state can be seen as data/state coming from the actual device (the current "truth") whereas thedesiredProperties
state is something an application in the backend or a mobile app would set as the new requested target state for a property.Example
For example, take a room thermostat:
reported
target-temperature also to 22reported = desired
for the target-temperature, the desired target-temperature is removed from the twinSequence diagram
The following sequence diagram shall illustrate the interaction pattern:
Show sequencediagram.org source of sequence diagram
Benefits
Currently, Eclipse Ditto foresees
features
of athing
(aka the digital twin) to contain data/state from real devices in theproperties
of the features.It is however not defined if those properties are reported or desired state. Up to now this had to be defined by the application developer modeling the data
to store in Ditto.
By defining in Ditto what is
reported
and whatdesired
property state, Ditto can provide several benefits for application developers:desiredProperties
can retrieve all desired state of a digital twin, e.g. on (re-)connection of the devicedefinition
(the information about the contained properties and their types) of a feature applies for both, reported and desired statedesiredProperties
state whereas an end user may be prohibited from changing thereported
stateThis GitHub issue shall act as the overall "epic" for all issues regarding the "desiredProperties" feature addition.
EPIC issues
Phase 1
Phase 1+x
Please feel free to start discussions about the overall concept in this issue and regarding the more specific topics in the linked issues.
The text was updated successfully, but these errors were encountered: