I am trying to implement a image recognition program in C++.
I had completed the extracted of feature, now trying to save the large amount of numbers. I had 2 implementation in mind, one is to save the data into binary files, to reduce the overhead of computation, or I can use database to keep the information.
Binary file is fast to read and write, but hard to access, while database seem an easier interface to work with, but I am not sure if the performance is fast enough.
Do you guys have any experience regarding fsream or database as the choice for fast persistent storage?
You could use SQLite. It basically gives to database-style access to local files. You can also create in-memory databases with it, but i do not know if it is possible to persist those.
Also, the best choice here heavily depends on your access patterns. If it is just sequenctial write and sequential read, then binary files are the best solution.