At what point is it worth using a database?

后端 未结 13 1383
广开言路
广开言路 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:23

    What you are describing doesn't sound like a typical business application, and many of the answers already posted here assume that this is the kind of application you are talking about, so let me offer a different perspective.

    Whether or not you use a database for 700 items is going to depend greatly on the nature of the data.

    I would say that, about 90% of the time at this scale, you will benefit from a light-weight database like SQLite, provided that:

    1. The data may potentially grow substantially larger than what you are describing,
    2. The data may be shared by more than one user,
    3. You may need to run queries against the data (which I don't think you're doing right now), and
    4. The data can easily be described in table form.

    The other 10% of the time, your data will be highly structured, hierarchical, object-based, and doesn't neatly fit into the table model of a database or Excel table. If this is the case, consider using XML files.

    I know developers instinctively like to throw databases at problems like this, but if you are currently using Excel data to design user interfaces (or display configuration settings), rather than display a customer record, XML may be a better fit. XML is more expressive than either Excel or database tables, and can be easily manipulated with a simple text editor.

    XML parsers and data binders for C++ are easy to find.

提交回复
热议问题