Deserialize the Kea JSON config lazily
Deserializing the big Kea config JSON is a very memory-consuming operation. It is stored in the config
column in the kea_daemon
table.
The entries of this table are used in many contexts in Stork. Whenever they are fetched, the JSON content is deserialized into Go structures, even if all or significant parts of this data are unnecessary, which is quite a common situation.
My proposal is to deserialize this JSON lazily - only when the related data are needed. The solution may be based on the RawMessage
feature of the encoding/json
package.