At what point is it worth using a database?

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

    Don't forget that the appropriate database can be quite different depending on your requirements (and don't forget that a text file could be used as a database if you're requirements are simple enough - for example, config files are just a specific kind of database). Such parameters might be:

    • number of records
    • size of data items
    • does the database need to be shared with other devices? Concurrently?
    • how complex are the relationships between the various pieces of data
    • is the database read only (created at build time and not changed, for example)?
    • does the database need to be updated by multiple entities concurrently?
    • do you need to support complex queries?

    For a database with 700 entries, an in-memory sorted array loaded from a text file might well be appropriate. But I could also see the need for an embedded SQL database or maybe having the controller request data from the database over a network connection depending on what the various requirements (and resource limitations) are.

提交回复
热议问题