Azure / opendigitaltwins-dtdl

Digital Twins Definition Language
Creative Commons Attribution 4.0 International
481 stars 163 forks source link

Increase Nested Schema Limit #182

Open felixse opened 6 months ago

felixse commented 6 months ago

The current DTDL v3 specification imposes a maximum depth of 5 levels for nested complex schemas. However, in certain scenarios, this limit might be too restrictive. For more complex digital twin models, especially those involving intricate hierarchies or deeply nested structures, a higher limit would be beneficial.

Proposal: I suggest revising the DTDL v3 specification to allow for a deeper nesting level, perhaps up to 10 levels. This change would enhance the flexibility and expressiveness of dtdl models.

jrdouceur commented 6 months ago

DTDL v3 can no longer be changed, but we are considering various limit increases for DTDL v4.

hichemfantar commented 1 month ago

@jrdouceur why was the limit set to 5?

jrdouceur commented 1 month ago

I don't recall the specific factors that led to the value of 5, but I know that it was driven by considerations of what IoT services were able to handle at the time. Limits in DTDL were set with the goal of ensuring that every DTDL-compliant service could accept any valid DTDL model.  Services commonly have workload limits to provide predictability, comprehensive testability, and DoS resilience.  Codifying these limits in the definition of DTDL assisted services with guaranteeing interoperability on models, and with providing support for composition and chaining.

Incidentally, for DTDL v4, this limit is expected to increase from 5 to 8.