Skip to content

deltas in maps #1

@aferrandi

Description

@aferrandi

Exmap will receive updates from external services and therefore the maps received will change their content with the time; the same will also happen for the maps results of calculations.
It is normal to think that in some cases the maps content will change only partially.
For example, if we have a map with one value per day, every day we will get one value more and the rest will remain the same; a calculation that summarizes the values per month will also update only one value of the output map (the current month)
In these cases it can be expensive to send the whole map to the clients.
To solve this problem a new map structure has to be added (DeltaMap), which includes only the changes (insertions, updates, removals) from the previous version of the map.
Here is a possible description of DeltaMap:

DeltamapAdd {
key: string,
value: V
}

DeltamapUpdate {
key: string,
value: V
}

DeltamapDelete {
key ; string
}

DeltaMapItem = DeltamapAdd | DeltamapUpdate | DeltamapDelete

DeltaMap = DeltaMapItem []

The system has to decide from time to time if it is convenient to send the whole map or only the delta; for example it can be more expensive to send the delta when more than 1/4 of the map has changed.
So both sender (the calculation) and the receivers (the server side entrypoint for external services + the elm client) have to cope with the new structure.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions