At what point is it worth using a database?

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

    It sounds like your application is running on a desktop computer and simply communicating to the embedded device.

    As such using a database is much more feasible. Using one on an embedded platform is a much more complex issue.

    On the desktop front I use a database when there is the need to store new information continuously and the need to extract that information in a relational way. What i don't use databases for is storing static information, information i read once at load and thats it. The exception is when the application has many users and there is the need to storage this information on a per user basis.

    It sounds be to me like your collecting information from your embedded device, storing it somehow, then using it later to display via a GUI.

    This is a good case for using a database, especially if you can architect the system such that there is a data collection daemon that manages the continuous communication with the embedded device. This app can then just write the data into the database. When the GUI is launched it can extract the data for display.

    Using the database will also ease your GUI develop if you need to display different views, such as "show me all the entries between 2 dates". With a database you just ask it for the correct values to display with a proper SQL query and the GUI displays whatever comes back allowing you to decouple much of the "business logic" code from the GUI.

提交回复
热议问题