Source Resources Compared to SQLite Database

I am creating an application that will use a lot of data, which is essentially static. I suggested that it makes sense to use a SQLite database to process this data. I am wondering if it makes sense to just use the XML file (s) and then refer to it as a raw resource. Keep in mind that there will probably be a lot of data, on the order of hundreds of individual parts.

Can you suggest that SQLite is best, both in terms of memory management and general design considerations, or does SQLite make no sense if the data is mostly static?

+4
source share
3 answers

In fact, SQLite seems pointless if the data is static. However, if you are going to manipulate a lot of data, you should use it:

  • Will be simpler:
    • To get data
    • Filter data
    • Sort data
  • Using XML files will lead to some performance issues due to the way SAX or DOM parses XML.
  • It will be easier for you to update this dataset in the future (imagine that you want to add more data to the next version)
+4
source

Christian is right. The database gives you the best access time and allows you to change data in a very convenient way. XML may be a better idea in the case of tree data structures.

In my opinion, there are two questions:

  • what data do you store?
  • You allow the user to change this data (for example, in the application or using Notepad)

There is also 1 big downside to XML - it is ultimately plaintext. So everyone can read it. To prevent this, you will have to encrypt the data (and that means extra effort). In the case of XML, using marshaling methods (JiBX, Castor, JAXB) can be convenient and can also reduce memory consumption.

Please describe what data you store in the database so that we can respond better.

0
source

Do you think your data has been overloaded (from sqlite database)? Since anyone with root as sqlite database can just extract the db file and use it

0
source

Source: https://habr.com/ru/post/897728/


All Articles