For my work I need to have a API where I can process data and save them for later usage, for example to return saved result if the request data is same.
Btw, I plan to use https://rocket.rs
since it looks simpler to use than alternatives, but I don't think it matter for the case.
In my case, an user sends data, I process this data and return the processed data.
Most likely the processed data will be in json
format.
So, my plan is to get a hash (sha256
or simpler one) and have this as a folder where I put all analysis from the data, there will be subfolders
as well to specify concrete analysis result, for example based on epoch
and these sub-folders will contain json
data a.k.a. the processed data. (the processed data may differ time to time so I need to have a way to differentiate them)
This is a structure I imagine for my project but not sure which database should I use to get similar structure.
my_db:
-- 196b0f14eba66e10fba74dbf9e99c22f // file hash
--1635252222 // analysis time / id
--json_data // actual data
--1635255525
--json_data
-- b95166980a3c526fddc54bb44a84e0fc
--1633344525
--json_data
-- d7ad85048dad5ef47f8f7f6ab6b9885e
...
Any recommendation which db
should I use and how to approach the problem from rust
side?
Fast lookup is more important than fast saving/writing, for example fast index lookup by hash would be really good.
I don't have experience in maintaining databases, so simpler is better