search

Home  >  Q&A  >  body text

javascript - How to save data locally

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?

仅有的幸福仅有的幸福2809 days ago640

reply all(3)I'll reply

  • phpcn_u1582

    phpcn_u15822017-06-05 11:14:44

    indexeddb

    reply
    0
  • 阿神

    阿神2017-06-05 11:14:44

    sqlite
    Highly recommended

    reply
    0
  • 为情所困

    为情所困2017-06-05 11:14:44

    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.

    reply
    0
  • Cancelreply