Raw resources versus SQLite database

前端 未结 3 483
醉酒成梦
醉酒成梦 2020-12-02 00:43

I\'m creating an application that will use a lot of data which is, for all intents and purposes, static. I had assumed it\'d make most sense to use a SQLite database to hand

相关标签:
3条回答
  • 2020-12-02 01:23

    Did you think of your data being stollen (from the sqlite database)? Because as a sqlite database, anybody with root can just pull the db file and use it

    0 讨论(0)
  • 2020-12-02 01:26

    Cristian is right. Database gives you better access time and allows to modify data in very convenient way. XML might be a better idea in case of tree-like data structures.

    In my opinion there are 2 question here:

    1. what kind of data are you storing?
    2. Do you allow user to modify this data (for example in application or using Notepad)

    There is also 1 big disadvantage of XML - it is eventually open text. So anyone can read it. To prevent it, you would have to encrypt the data (and this means additional effort). In case of XML, using marshaling techniques (JiBX, Castor, JAXB) might be convenient and might also lower memory consumption.

    Please describe what kind of data you are storing in DB, so we might come up with better answer.

    0 讨论(0)
  • 2020-12-02 01:41

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

    • It will be easier to:
      • Retrieve data
      • Filter data
      • Sort data
    • Using XML files will cause some performance problems because of the way in which SAX or DOM parses XML.
    • It will be easier for you to update that set of data in the future (imagine that you want to add more data in the next release)
    0 讨论(0)
提交回复
热议问题