Results 1 to 10 of 10

Thread: [RESOLVED] Where should the database go?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    Resolved [RESOLVED] Where should the database go?

    Publishing/distributing an application truly confusing and complex. I am sure it is not supposed to be, but it is. I have finally gotten through the basics and, most of the time, successfully carry out this process. However, there are a couple of things I am wondering about, with regard to publishing/distributing a database application.

    My applications are pretty simple and while they require a database, they do not require, nor are they well served, using a server-based database. It has been my practice to include the database as part of the package that I publish to load on another machine. However, I am beginning to see problems with that approach and am now considering that I might be better served to publish/distribute the application without including the database in the package and installing the database separately to the specific place called for in the application connection string.

    I am just looking for pros and cons as to what would make a better approach.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: Where should the database go?

    To clarify, this is a desktop application? Also, what language are you using?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    Re: Where should the database go?

    It is a deskstop planner application. The language is Visual Basic. The database is an Access database.

    What I am after is the best approach, with regard to the database, to distribute the application and database to another machine. What I have done, in the past, is to load the database as part of the distribution package. I am not certain that this is a better approach than just distributing the application and separately loading the database into the location specified in the connection string of the application.

    I have had mixed results with packaging the database as part of the distribution package. Additionally, I intend to update this application and I am not sure how I would do an update without affecting the data, using the distribution package containing the database. This is all way too complicated for me.
    Last edited by gwboolean; Oct 17th, 2023 at 07:34 PM.

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: Where should the database go?

    Which Visual Basic, .NET or legacy?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    Re: Where should the database go?

    That would be .Net

    Sorry to give this out piecemeal, but I really have no idea what is important for this.

  6. #6
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,630

    Re: Where should the database go?

    What is the database being used for? Is the end user taking actions that is resulting in changes being made to the data?

    I know you want application updates to not mess with the data, but what if the application update includes changes within the database itself, such as new tables being added, or additional fields added to existing tables, etc? In that case the database does need to be "touched" at the very least for those changes to be made.

  7. #7
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,261

    Re: Where should the database go?

    For filebased Databases (MS Access, SQLite), just ask yourself the following question:
    Is the Data within the Database
    1) just for the logged in User,
    2) or should the Data be available to any logged in User?

    In case of Answer 1: AppData\Local (or roaming)
    In Case of Answer 2: c:\ProgramData (hidden Folder)

    Or you do the "Deluxe"-Version: At first start-up of the program, ask the User, where to CREATE the Database!
    (This implies you have all necessary SQL-Statements available to your Program at start-up).
    In case of Answer 2, the chosen Location must be accesible to all users

    SideNote: In case of "Multi"-User (more than 1 User (on different machines --> Network)) using the Database at the same time:
    Use a DB-Server. Period!
    Don't try to outsmart it by placing the Database on a Network-Share.
    You're inviting trouble that's not worth it
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    Re: Where should the database go?

    What is the database being used for?
    This application is a planner. The database is used to maintain records of tasks, contacts, et. al., information. The user would be able to add, delete and modify the data.

    I know you want application updates to not mess with the data
    Absolutely. I am also aware that a database might require changes, just as the application would. Which is something that seems so complicated that I am looking at the possibility of handling the database completely separate from the application for publishing/updating.

    It seems to me that handling them separately would be relatively simple. In the case of this application, the number of users is so small, that I can easily update the user database without blowing their data out of the water.

    Updating someone's database used to be a really, really big job and I am afraid that if I attempt to update the database, as part of the publish/update process, that things will go very badly for me. That word, "touch", scares the hell out of me. I can do a straight forward, by hand, update of a simple user database that contains data. But I have seen nothing providing any information about how to actually carry something like that out in the publish/update process. And I likely wouldn't understand it if I did.

  9. #9
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,630

    Re: Where should the database go?

    Quote Originally Posted by gwboolean View Post
    This application is a planner. The database is used to maintain records of tasks, contacts, et. al., information. The user would be able to add, delete and modify the data.



    Absolutely. I am also aware that a database might require changes, just as the application would. Which is something that seems so complicated that I am looking at the possibility of handling the database completely separate from the application for publishing/updating.

    It seems to me that handling them separately would be relatively simple. In the case of this application, the number of users is so small, that I can easily update the user database without blowing their data out of the water.

    Updating someone's database used to be a really, really big job and I am afraid that if I attempt to update the database, as part of the publish/update process, that things will go very badly for me. That word, "touch", scares the hell out of me. I can do a straight forward, by hand, update of a simple user database that contains data. But I have seen nothing providing any information about how to actually carry something like that out in the publish/update process. And I likely wouldn't understand it if I did.
    Based on what you've said, I would recommend keeping it as simple as possible, which may mean doing some things manually yourself.

    With every process like this, there's a tipping point at which doing things manually doesn't make sense any more. But conversely, underneath that tipping point it can often not make sense to try to do a bunch of automated stuff, since the time and effort necessary to put in to automating and testing everything to make sure the automated process is bulletproof would only result in an actual time savings for you like 50 years down the road. There's nothing wrong with banging on other people's keyboards when necessary.

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    Re: Where should the database go?

    That is sound advice. I always have a tendency to want to do more than my capabilities or needs permit.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width