Store data in a database instead of json files (state.dat and files in datadir)
There were multiple bugs parsing those files, data has to be converted back and forth from the files to python data structures and viceversa and some of the json data resulted being huge (#40020 (closed)).
This would imply to change all data structures and logic to handle them.