Skip to content
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

Time to live (TTL) for Ditto Properties with auto removal #746

Open
JulianFeinauer opened this issue Jul 23, 2020 · 2 comments
Open

Time to live (TTL) for Ditto Properties with auto removal #746

JulianFeinauer opened this issue Jul 23, 2020 · 2 comments

Comments

@JulianFeinauer
Copy link
Contributor

In some scenarios one may record some kind of limited history in a twin like e.g. productivity of the last 12 hours.
This can be modelled today with arrays or a special struct architecture but not very elegant (with simple updates of one value).

This could be overcome if each property could have an optional TTL and Ditto takes care of automatically removing the property when the TTL is expired.
Then one could simply push values (as in the example above) as properties "timestamp" -> value and set the TTL accordingly to 12h.

One idea could be to implement this with regards to the extended metadata model in #680.

@JulianFeinauer
Copy link
Contributor Author

I would try to start with the implementation of this after #680 / #745 is finished. My first approach would be to store a special metadata about the TTL in the metadata of the thing and check in the AbstractThingEventStrategy if a property needs to be removed.
Does that make sense or do you suggest another approach @thjaeckle ?

@thjaeckle
Copy link
Member

That sounds reasonable.
What we would need then is a class/enum/whatever where the Ditto "known metadata" fields are defined.
"Knowing" meaning that Ditto has to apply semantic meaning to that metadata and does something automagically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants