Recently I encountered a requirement when writing a desktop software using electron: to save the data filled in by the user locally. My usage is to save the data locally in the form of a file, but I encountered a problem. The more you save, the bigger the file will be, like this. The speed of reading files will become slower and slower, and the files must be re-read every time, which is really slow. . . So I would like to ask all developers, how can a desktop software save data locally? Is there any kind of database that can be integrated into the software and then the software can be used?
indexeddb
sqlite
Highly recommended
For this problem, it depends on your data volume. For data that is not particularly large, you can use SQLite or divide the data file into multiple files to store, and create an index for each file. Here you can refer to the inverted index, and then fetch the data When doing so, use relevant algorithms to locate the corresponding file and retrieve the data.
,,,,,,,
For a large amount of data, you need to change the design plan and take advantage of nosql type databases, such as redis and hbase.