Android Performance : Flat file vs SQLite

后端 未结 2 1333
轮回少年
轮回少年 2020-12-06 09:25

There are few questions related to this topic on stackoverflow, But I didn\'t get the proper answer. I have some doubts on performance of flat files, Is it better to use

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-06 10:05

    Aside from performance benefits, here's a simple list of advantages of using SQLite rather than flat file:

    • You can query items as you wish -- don't need to load all of them and select which ones you need.
    • Deleting records is a much less painful process. No rewriting of whole files into wherever.
    • Updating a record is as easy as removing or creating one.
    • Have you ever tried doing cross-referencing lookups on a flat file? Not worth it.

    To summarize, it's every advantage a Database has over a text file.

提交回复
热议问题