Re: Writing data to disk?!
- From: "Me" <me@xxxxxxxx>
- Date: Mon, 19 Dec 2005 20:50:32 -0500
What you really need to ask yourself is how you or your customer wants to
store "data" and what exactly the "data" is. Different formats (database,
flat file, etc) have pro's and con's with them and they need to be
considered when making this decision. You should not look for the "simple"
way to do data storage but instead look for the method that gives you and/or
your customer what is needed.
For instance here are some questions/thoughts for you to consider when
choosing a data storage design.
Is the data going to be shared (updated, added to, deleted from, etc) my
multiple users? If so then a DB is better because it has the notion of
locking records.
Is the data very simple? Maybe an XML file would work if it is only
configuration information being saved.
Will there be the notion of multiple instances of these files (user 1, user
2, etc.)? Maybe flat files would be better for this.
Will there be only 1 instance that is shared by multiple users? Maybe a DB
would be better.
How will the data be upgraded? How will this be handled - copies of
files/tables or some other method.
Will you need want to keep a "roseta stone" (aka key) to some home brewed
file format? This is something that you will need if you do not follow some
standard format (database, xml, etc). You dont want to open up a file and
have a bunch of garbage in it and have no clue what it is do you?
Is it a bunch of small values or only 1 or 2 large/huge values (such as an
image)?
Will you need to query this data for a report or something? Databases are
great for this!
Who will be responsible for backing up the data? Your program (maybe flat
files are better) or will your customers IT department handle this (database
server is better maybe)? This is a very important one to keep in mind since
if your program handles user entered data they will want a backup to be done
at some point and if you can push it off on them then it is one less thing
for you to worry about when the system crashes!
As for what options you have here are a few that I can think of. I am sure
there are others though.
- Database servers (SQL Server, MySQL, etc.)
- Database files (Access, etc.)
- XML
- INI files
- Registry
- Flat text files
- Flat binary files (home brewed files)
What is all comes down to is requirements. Either the ones your customer
imposes on you, or the ones that your application imposes on your customer.
You cannot support everything in every application... or can you? :-)
Hope this helps!
"Chris Springer" <cspring@xxxxxxxxxxxx> wrote in message
news:m7ednR_nCLOPzjreRVn-qA@xxxxxxxxxxxxxxx
> I'd like to get some feedback on the issue of storing data out to disk and
> where to store it. I've never been in a production environment in
> programming so you'll have to bear with me...
>
> My question is about storing data in a database. Yes I understand that
> you can link to a database in your program and read and write to the
> database etc etc. Well, that's all find and dandy but what if the person
> you're writing the application for doesn't have SQL/Access or some other
> database provider to use? Does Microsoft provide a class library to make
> disk/data storage simpler without having to write individual pieces of
> data out to disk? I've done a bit of searching through the MSDN online
> documentation using Serialization, marking code as serializable, and then
> writing it out to disk...and actually got it to work...but is this
> efficient or does MS have another way that's simpler? I'd just like some
> feedback if anyone has the time...
>
> Thanks,
>
> Chris
>
> --
> Securing your systems is much like fighting off disease -- as long as you
> maintain basic hygiene, you're likely to be okay, but you'll never be
> invulnerable.
>
> Steve Shah - Unix Systems Network Administrator
>
.
- Follow-Ups:
- Re: Writing data to disk?!
- From: Chris Springer
- Re: Writing data to disk?!
- References:
- Writing data to disk?!
- From: Chris Springer
- Writing data to disk?!
- Prev by Date: RichTextBox horizontal scrollbar
- Next by Date: MissingManifestResourceException after renaming namespace
- Previous by thread: Re: Writing data to disk?!
- Next by thread: Re: Writing data to disk?!
- Index(es):
Relevant Pages
|