Konard / LinksPlatform

Holistic system for storage and transformation of information based on associative model of data. Целостная система для хранения и обработки информации, основанная на ассоциативной модели данных.
https://linksplatform.github.io/Documentation/
GNU Lesser General Public License v3.0
57 stars 8 forks source link

Editable array with infinite length #591

Open Konard opened 3 years ago

Konard commented 3 years ago

Array that or bit string that immutably editable. Each the change is required the updated range of values is written to the end of the array. Each range knows it's size, it also may have reference to one or more next ranges (only this references may be mutable).

This can be applied for bitstrings.

If it is efficient to rebuild that array it can be easily rebuild by reading all ranges and merging it to the single range. Reading should be done from the end to the beginning to avoid repeated write to the same parts of the region.

Each range can have offset and length. The total length of array is not limited. When saved to file we should save the size of offsets, lengths and elements to be able read the file in future if something changes. We should also store default element's value that will fill up all not defined ranges in the array.