You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As data models evolve, the schemas and types for the data models must also evolve. Users of Ion Schema may need to interact with one or more out of many versions of the same schema(s) and/or type(s).
The Problem
Even if we can start by assuming there is a single version numbering system that works for everyone (a dubious possibility), it is unlikely that there can be a one-size-fits-all solution for everyone—there are at least three dimensions to this problem.
At what level does the versioning occur?
For a directory (or other group) of schema documents?
For individual schema documents?
For types within a schema document?
A combination of the above?
What sort of version resolution is needed?
Get an exact version
Resolve to latest in range of versions
Resolve to a union of a range of versions (E.g. my_type-2.x is equivalent to any_of: [my_type-2.0, my_type-2.1, ...] )
Resolve to an intersection of a range of versions (E.g. my_type-2.x is equivalent to all_of: [my_type-2.0, my_type-2.1, ...] )
Some combination of the above?
Can dependency versions be locked/pinned?
Yes? (E.g. type customer-1.1 has a dependency on address-1.any which resolves to a union of address-1.0 and address-1.1. Once address-1.2 exists, the customer-1.1 dependency on address-1.any still resolves to a union of address-1.0 and address-1.1.)
No? (E.g. type customer-1.1 has a dependency on address-1.any which resolves to a union of address-1.0 and address-1.1. Once address-1.2 exists, the customer-1.1 dependency on address-1.any now resolves to a union of address-1.0, address-1.1, and address-1.2.)
Some combination of the two?
Initial Thoughts
Ion Schema does not permit two types with the same name to exist in any particular scope. However two versions of the same type can co-exist by mangling the type name with a version number. Resolving (some) ranges of dependencies can be done by creating new types that are aliases to another type or a union or intersection of multiple other types. These same principles can also be applied to schemas. The difficulty with this approach is that name mangling requires increasing amounts of effort to maintain as the size of a project and the number of versions grows.
The text was updated successfully, but these errors were encountered:
Also something to keep in mind—ion-schema-schemas will need some sort of solution to this problem when we have an updated version of the Ion Schema Language.
As data models evolve, the schemas and types for the data models must also evolve. Users of Ion Schema may need to interact with one or more out of many versions of the same schema(s) and/or type(s).
The Problem
Even if we can start by assuming there is a single version numbering system that works for everyone (a dubious possibility), it is unlikely that there can be a one-size-fits-all solution for everyone—there are at least three dimensions to this problem.
At what level does the versioning occur?
What sort of version resolution is needed?
my_type-2.x
is equivalent toany_of: [my_type-2.0, my_type-2.1, ...]
)my_type-2.x
is equivalent toall_of: [my_type-2.0, my_type-2.1, ...]
)Can dependency versions be locked/pinned?
customer-1.1
has a dependency onaddress-1.any
which resolves to a union ofaddress-1.0
andaddress-1.1
. Onceaddress-1.2
exists, thecustomer-1.1
dependency onaddress-1.any
still resolves to a union ofaddress-1.0
andaddress-1.1
.)customer-1.1
has a dependency onaddress-1.any
which resolves to a union ofaddress-1.0
andaddress-1.1
. Onceaddress-1.2
exists, thecustomer-1.1
dependency onaddress-1.any
now resolves to a union ofaddress-1.0
,address-1.1
, andaddress-1.2
.)Initial Thoughts
Ion Schema does not permit two types with the same name to exist in any particular scope. However two versions of the same type can co-exist by mangling the type name with a version number. Resolving (some) ranges of dependencies can be done by creating new types that are aliases to another type or a union or intersection of multiple other types. These same principles can also be applied to schemas. The difficulty with this approach is that name mangling requires increasing amounts of effort to maintain as the size of a project and the number of versions grows.
The text was updated successfully, but these errors were encountered: