Has it ever been considered to use in-memory databases?

There is one more thing with that: The historical data.

Honestly: Historical data should be separated from the actual data.
This would help for 2 reasons:

  1. The databases and their (in-)memory footprint would become significantly smaller.
  2. In case of database problems the SNO would not lose the historical data but only let’s say the actual month or something.

Historical data don’t need fast access and almost never an update and could easily exist as a flat file on a spinning disk.

1 Like

It would require a separate chore to move data from the operational database to the historical database, it also will require to redo how this information is handled in the storagenode API (it must combine data from two sources (three if we account both operational databases - in-memory and on the disk, also historic DB) for each metric).
it’s as complicated as it sounds. As result - it likely slow down the node and anything what would request these metrics.

I do have more hope into this research:

Yes it would require to find a way to manage that. But the general idea is clear: Basically you have 2 databases where necessary. My idea would be to have one for the current month and one for the historical data. After each month the data is moved into the historical database. The API then would query the current months database for the current months data and the historical database when data before that is requested.

At the end I don’t mind what solution will be implemented.
But I strongly hope that Storj will work something out to eliminate these database and IO issues. It is too sad to spend IOs on database operations and not for execution on customer files.

… and three if you request an overlap interval. So, it should be supported. This is what would make it complicated.
However, let developers to decide how it might be implemented.

There’s a third approach possible: update bandwidth.db while sending orders. Orders already have information on the amount of bandwidth spent, and they are sent on a regular basis.

1 Like