Libelektra: Can we promise users that any storage plugin can be used for any application?

Created on 15 Oct 2020  路  2Comments  路  Source: ElektraInitiative/libelektra

@kodebach wrote in #3223

Of course, if you just change your mind and say a storage format can limit Elektra's abilities the problem goes away. But that fundamentally changes Elektra's promise to users. We would limit all users just to allow some developer to safe a few lines of code dealing with encoding special values.

If it would be like this, it would be crazy to do so. But afaik it is not "a few lines of code" but basically all the complexity that storage plugins have (mini vs. toml). Yes, I do not think we should promise users that they can use any storage plugin without any problems. As we clearly see with even very highly evolved storage plugins like YAML and TOML (which used up hundreds of hours development time) this was a wrong promise to begin with.

@bauhaus93 @sanssecours Can you please comment? Is it realistic that storage plugins will be able to accept

  • any key name
  • any key value
  • any valid key set structure (i.e. everything but arrays intermixed with non-arrays) including

    • arbitrary holes

    • values at arbitrary keys in the middle (i.e. non-leaf values with arbitrary names)

  • all types Elektra supports

Or said differently: where are the limitations? What can we really offer to applications to rely on?

question

Most helpful comment

Can we promise users that any storage plugin can be used for any application?

No 馃槉

In general I think the suitability of a certain storage plugin for a certain task depends on

  1. the storage format, and
  2. the mapping between Elektra鈥檚 data structures and the storage format.

For the YAML file format I am pretty sure that we should be able to store every part of a KeySet structure without problems, if we do not care much about the mapping. In general: If you can map something into a graph without multi-edges (circles are fine) then you should be able to store it as YAML data.

However, the current YAML plugins most certainly do not support every possible KeySet. I am pretty sure, that support for most data should be possible though, if someone decides to invest more work into the plugins.


Note: For the following questions all my answers assume that we use YAML as storage format with the current hierarchical mapping.

Is it realistic that storage plugins will be able to accept

  • any key name

If we assume that mixing array data and non-array data at the same level is possible, then no. For example, storing something like

{ "user:/array", KEY_META, "array", "#0" }
{ "user:/array/#0", KEY_VALUE, "something" }
{ "user:/array/name", KEY_VALUE, "some other thing" }

is not possible.

  • any key value

Yes

  • any valid key set structure (i.e. everything but arrays intermixed with non-arrays) including

    • arbitrary holes

Yes

  • values at arbitrary keys in the middle (i.e. non-leaf values with arbitrary names)

No

all types Elektra supports

In theory that should be possible.

All 2 comments

Can we promise users that any storage plugin can be used for any application?

No 馃槉

In general I think the suitability of a certain storage plugin for a certain task depends on

  1. the storage format, and
  2. the mapping between Elektra鈥檚 data structures and the storage format.

For the YAML file format I am pretty sure that we should be able to store every part of a KeySet structure without problems, if we do not care much about the mapping. In general: If you can map something into a graph without multi-edges (circles are fine) then you should be able to store it as YAML data.

However, the current YAML plugins most certainly do not support every possible KeySet. I am pretty sure, that support for most data should be possible though, if someone decides to invest more work into the plugins.


Note: For the following questions all my answers assume that we use YAML as storage format with the current hierarchical mapping.

Is it realistic that storage plugins will be able to accept

  • any key name

If we assume that mixing array data and non-array data at the same level is possible, then no. For example, storing something like

{ "user:/array", KEY_META, "array", "#0" }
{ "user:/array/#0", KEY_VALUE, "something" }
{ "user:/array/name", KEY_VALUE, "some other thing" }

is not possible.

  • any key value

Yes

  • any valid key set structure (i.e. everything but arrays intermixed with non-arrays) including

    • arbitrary holes

Yes

  • values at arbitrary keys in the middle (i.e. non-leaf values with arbitrary names)

No

all types Elektra supports

In theory that should be possible.

Thank you very much for the answer!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus2330 picture markus2330  路  3Comments

markus2330 picture markus2330  路  3Comments

dominicjaeger picture dominicjaeger  路  3Comments

sanssecours picture sanssecours  路  4Comments

e1528532 picture e1528532  路  4Comments