Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

SQLite and C#

Options
  • 22-10-2018 10:36am
    #1
    Registered Users Posts: 1,547 ✭✭✭


    I hope that this is the correct forum to post this question. (very much an amateur at this.) The question concerns database design and C# !
    I have an application which require collection of data in the field and then various manipulations. I I have an Android app to collect the data and C# desktop application to do the various calculations. I had originally use collections etc. in C# but wanted to persist the data and when I discovered Sqlite database I migrated the application to use SQlite.
    But I feel the application I have now is very messy . Partly, I am manipulating data in the database, at other times I am copying the database into collections , manipulating them and dumping back to the database.
    My question is about proper design here. Would it be normal to dump a database to collections , manipulate the data an then transfer back to the database, or should I be doing manipulations on the database directly or is there a different design I should be using?
    I appreciate that the final result would be the same but I am trying to teach myself the ‘right way’ of doing it. The database consists of about 6 tables and takes up only about 20 kb on disk ( this might be compressed – I don’t know).
    Any idea how I should go about designing this
    Sorry for the rather long post! Thanks for reading and any input would be much appreciated


Comments

  • Registered Users Posts: 635 ✭✭✭MillField


    When you say that you have a C# desktop application to do calculations on the data, do you mean that this is constantly running, waiting for the Android application to send it data?

    Generally speaking, a database should only be a read/write one off operation for the data in question so it seems like a bad idea to be going back and forth doing these calculations.

    Ideally:

    1. Collect the data
    2. Perform any calculations necessary
    3. Write to database


  • Moderators, Recreation & Hobbies Moderators Posts: 11,076 Mod ✭✭✭✭igCorcaigh


    Best to use the database purely to save the state of your data.

    Any modifications can be performed in memory on your collections.

    Of course, this is all dependent on your requirements.


  • Moderators, Recreation & Hobbies Moderators Posts: 11,076 Mod ✭✭✭✭igCorcaigh


    Are you using the desktop app as a way of avoiding the cost of cloud services?


  • Registered Users Posts: 1,547 ✭✭✭rock22


    Thanks, guys, for the replies. To answer some of your questions
    The application is not running constantly. All files are loaded and calculation performed in one session.
    I haven't really looked at cloud based services. However this is a very simple application so desktop database is probably a better fit.

    I think you have answered my questions on design. I will go about tidying things up .

    regards


Advertisement