At what point is it worth using a database?

后端 未结 13 1388
广开言路
广开言路 2020-11-29 18:26

I have a question relating to databases and at what point is worth diving into one. I am primarily an embedded engineer, but I am writing an application using Qt to interfa

13条回答
  •  清酒与你
    2020-11-29 19:24

    There isn't a specific point at which a database is worthwhile. Instead I usually ask the following questions:

    • Is the amount of data the application uses/creates growing?
    • Is the upper limit of this data growth unknown (or unclear)?
    • Will the application need to aggregate or filter this data?
    • Could there be future uses of the data that may not be obvious right now?
    • Is performance of data retrieval and/or storage important?
    • Are there (or could there be) multiple users of the application who share data?

    If I answer 'Yes' to most of these questions I almost always choose a database (as opposed to other options such as XML/ini/CSV/Excel/text files or the filesystem).

    Also, if the application will have many users who could be accessing the data concurrently, I'll lean towards a full database server (MySQL, SQl Server, Oracle etc).

    But often in a single user (or small concurrency) situation, a local database such as SQLite cannot be beaten for portability and ease of deployment.

提交回复
热议问题