1

I am working on a fairly simple reporting application. It will (after some time) hold a fair amount of data. As an over view of the project itself its going to hold records of how much work was done, by who, how many stitches were used in an embroidery project and other easy to keep track of data but will pile up over time. When reporting I would like to be able to keep track of all of this, yearly, monthly, ect.

I was just looking for some options as to storing the data. The simple way would be text files but It doesn't really seem to 'professional' to me. A SQL database seems like over kill and since this program is likely to only be on one or two computers there isn't a real need to have to install a SQLlite on to them. I also realize that there is a way to use SQL database files (.mdf's) but at that point I may as well just connect to a sql database.

Any suggestions?

Mason Toy
  • 109
  • 9
  • 1
    I always go against flat files and xml files, they were never meant to. please check out this post [link](http://stackoverflow.com/questions/201568/when-would-i-use-xml-instead-of-sql) there's always ms access db file. if you need a non managed file – Suing Apr 13 '15 at 23:31

2 Answers2

3

The decision to use a database vs flat files will really be driven by which approach more easily addresses the requirements of your application.

If you're working with small datasets that fit comfortably in available memory, don't need to support concurrent access, foreign keys, or any number of other features that relational databases provide, then there's nothing wrong with using flat files (such as XML or JSON) to store your data. In other words, if you're not benefiting from the use of a database, why use it?

For reporting purposes with flat files, you will likely have a corresponding object model that you hydrate from your flat file and then query with LINQ.

You may also consider using an abstraction such as the Repository pattern to shield the rest of your code from the details of whichever approach you select.

Michael Petito
  • 12,891
  • 4
  • 40
  • 54
  • Thanks a ton @Michael I was considering looking into JSON, I haven't worked with it yet so I was tentative to give it a try. I may still use SQL I'll have to asses things further. Thanks for the input! – Mason Toy Apr 14 '15 at 14:04
1

You want to store relations between different types of objects (projects, stiches, people etc.), write reports, update data... I think that SQL database suits here very well and it will not be an over-kill. If you used XML or flat files you would have to implement all these things on your own. With XML it should be easier than with flat files nonetheless it would requried much more work and would be much more error prone than using SQL database.

You don't have to use "big" database like SQLServer or Oralce. You mentioned SQLLite which seems to be a good choice because you don't have to install it on every machine where your program will be used. It will be distributed together with you program.

Michał Komorowski
  • 6,198
  • 1
  • 20
  • 24
  • It's a tough call in the situation for me, its nothing to complex. It would be nice to use all the advantages of a relational database but at times it seems like too much. I may use SQL or as Michael (in the comment above) suggests JSON regardless, Thanks a ton for the input @Michal ! – Mason Toy Apr 14 '15 at 14:06