Results 1 to 10 of 10

Thread: [RESOLVED] DataFile vs DataBase

  1. #1

    Thread Starter
    Lively Member VisualBrian's Avatar
    Join Date
    Nov 2019
    Location
    North America
    Posts
    72

    Resolved [RESOLVED] DataFile vs DataBase

    Let us say that I want to create a custom Sales and Inventory application for a client. What is the advantage of using a database over using datafiles? Can't they both store the same information and access the same data?
    I may not know anything, but I know it well!

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

    Re: DataFile vs DataBase

    Quote Originally Posted by VisualBrian View Post
    Let us say that I want to create a custom Sales and Inventory application for a client. What is the advantage of using a database over using datafiles? Can't they both store the same information and access the same data?
    One difference is that you'll end up writing a ton of low level housekeeping code to interact with and update your data file. That work is already done for you if you use a database.

  3. #3

    Thread Starter
    Lively Member VisualBrian's Avatar
    Join Date
    Nov 2019
    Location
    North America
    Posts
    72

    Re: DataFile vs DataBase

    I love this place and thank you for your response.
    Forgive me as I'm not very experienced (I do this for fun), but it is my understanding that I must update either a database or a datafile with new information when it changes. What exactly is the low level housekeeping code you refer to?
    I may not know anything, but I know it well!

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,508

    Re: DataFile vs DataBase

    There's thing like Primary Key, Foreign Key and data organization. ADO .Net was designed to Edit/Update/Delete database data. Why would you not use a database for a Sales/Inventory system???

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

    Re: DataFile vs DataBase

    Quote Originally Posted by VisualBrian View Post
    I love this place and thank you for your response.
    Forgive me as I'm not very experienced (I do this for fun), but it is my understanding that I must update either a database or a datafile with new information when it changes. What exactly is the low level housekeeping code you refer to?
    What's easier? To use a Roomba, or to build a vacuum cleaner yourself from necessary parts (motor, collection bag, tubes, cords, rotating brush, etc.) It can be argued that both take money, electricity, and time.

    The answer is obvious.

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: DataFile vs DataBase

    If you use a DataGridView, DataTable, DataAdaptor and a CommandBuilder, you don’t have to handle your Add/Update/Delete commands. It can all be done with a few lines of code…

  7. #7
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,508

    Re: DataFile vs DataBase

    I actually just showed how to do that here https://www.vbforums.com/showthread....ers-for-SQLite

    Post #10

  8. #8
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    Re: DataFile vs DataBase

    Either way can get the job done. The question really comes down to scale. Adding a database does require a bit of work that you wouldn't need with a datafile, but you get a lot of extra capability from that extra work. Therefore, the tradeoff is a bit hard to figure, though it almost always ends up favoring the database in the long run.

    Datafiles can be extremely simple and easy to work with, so long as the limitations of the datafile are acceptable. If all you are doing is working with one table, or something so simple that you could put it into a single sheet of a spreadsheet (not numerous pages in a workbook), then the datafile would be the way to go up until the size of the thing got quite large.

    If the data gets quite large, or covers multiple tables, especially tables that relate together in some way, then the capabilities offered up by a database are sufficiently advantageous that a database becomes the choice over a datafile. For that reason, most data management projects end up using databases. Those projects simple enough that a datafile is sufficient, tend to be rare.

    Also, what starts as a small project, if reasonably successful, tends to snowball over time, which means that you might start out with something that can reasonably fit in a datafile....and then it no longer does.
    My usual boring signature: Nothing

  9. #9
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,508

    Re: DataFile vs DataBase

    A Sales and Inventory system is not a simple one table application. If this is your goal then I'd suggest learning how to work with a database.

  10. #10

    Thread Starter
    Lively Member VisualBrian's Avatar
    Join Date
    Nov 2019
    Location
    North America
    Posts
    72

    Re: DataFile vs DataBase

    Quote Originally Posted by Shaggy Hiker View Post
    Either way can get the job done. The question really comes down to scale. Adding a database does require a bit of work that you wouldn't need with a datafile, but you get a lot of extra capability from that extra work. Therefore, the tradeoff is a bit hard to figure, though it almost always ends up favoring the database in the long run.

    Datafiles can be extremely simple and easy to work with, so long as the limitations of the datafile are acceptable. If all you are doing is working with one table, or something so simple that you could put it into a single sheet of a spreadsheet (not numerous pages in a workbook), then the datafile would be the way to go up until the size of the thing got quite large.

    If the data gets quite large, or covers multiple tables, especially tables that relate together in some way, then the capabilities offered up by a database are sufficiently advantageous that a database becomes the choice over a datafile. For that reason, most data management projects end up using databases. Those projects simple enough that a datafile is sufficient, tend to be rare.

    Also, what starts as a small project, if reasonably successful, tends to snowball over time, which means that you might start out with something that can reasonably fit in a datafile....and then it no longer does.
    First, thank you for a very helpful response and actually answering the question. (What is the advantage of using a database over using datafiles?)
    My friend has a small concession stand in the hallway between the PX and Commissary of the local military base. She doesn't handle more than 50 items and could probably continue to run it quite well on paper and memory but wanted to see about making it more formal and easier to record/view the big picture. Since I've been working with datafiles for a long time and the task was small, I felt it would easily handle the job.
    One thing I didn't consider is "tables that relate together in some way" and I can see the advantage to that even in such a small project.
    I may not know anything, but I know it well!

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