5 Replies - 934 Views - Last Post: 04 September 2013 - 04:57 PM Rate Topic: -----

#1 salazar  Icon User is offline

  • D.I.C Addict

Reputation: 87
  • View blog
  • Posts: 539
  • Joined: 26-June 13

Sql or Xml for flat files?

Posted 31 August 2013 - 08:13 PM

If I wanted to store simple lists, nothing to complex, should I go with sql or xml? I did some research and what I want to store most resembles a "flat file". And in my researched, I found that xml is best with storing flat files. I thinking about going with xml, but i'm not entirely sure. What do you guys think?
Is This A Good Question/Topic? 0
  • +

Replies To: Sql or Xml for flat files?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9180
  • View blog
  • Posts: 34,470
  • Joined: 12-June 08

Re: Sql or Xml for flat files?

Posted 31 August 2013 - 09:24 PM

Yes.. XML is universally a good flat file system.
Was This Post Helpful? 0
  • +
  • -

#3 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 795
  • View blog
  • Posts: 1,681
  • Joined: 30-January 09

Re: Sql or Xml for flat files?

Posted 31 August 2013 - 11:16 PM

For datasets that rarely change, are read-only, and require no relation to more complex objects, XML files is a good option. Storing everything under the sun in the DB is a bit of an anti-pattern, in that your application will incur the overhead of connecting to the DB every time you need to retrieve that data. Accessing the file system tends to be a lot faster. Here is an example of data that I could have put in the database, but opted for an XML file instead:
Spoiler

This post has been edited by e_i_pi: 31 August 2013 - 11:17 PM

Was This Post Helpful? 1
  • +
  • -

#4 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5817
  • View blog
  • Posts: 12,666
  • Joined: 16-October 07

Re: Sql or Xml for flat files?

Posted 01 September 2013 - 03:03 AM

Well storing SQL in a flat file doesn't make all that much sense...

XML is a wonderful markup where you can describe damn near anything, so it's a good general purpose option. Of course, if it's just a simple list, you could just have a simple text file.

However, why? For reading, anything will do. Are your writing? Is it for a program? If it is for a program, does is make more sense to simply store the data in the program?
Was This Post Helpful? 1
  • +
  • -

#5 salazar  Icon User is offline

  • D.I.C Addict

Reputation: 87
  • View blog
  • Posts: 539
  • Joined: 26-June 13

Re: Sql or Xml for flat files?

Posted 04 September 2013 - 04:51 PM

View Poste_i_pi, on 31 August 2013 - 11:16 PM, said:

For datasets that rarely change, are read-only, and require no relation to more complex objects, XML files is a good option. Storing everything under the sun in the DB is a bit of an anti-pattern, in that your application will incur the overhead of connecting to the DB every time you need to retrieve that data. Accessing the file system tends to be a lot faster. Here is an example of data that I could have put in the database, but opted for an XML file instead:
Spoiler


Thanks for the great answer. That's what a thought as well
Was This Post Helpful? 0
  • +
  • -

#6 salazar  Icon User is offline

  • D.I.C Addict

Reputation: 87
  • View blog
  • Posts: 539
  • Joined: 26-June 13

Re: Sql or Xml for flat files?

Posted 04 September 2013 - 04:57 PM

View Postbaavgai, on 01 September 2013 - 03:03 AM, said:

Well storing SQL in a flat file doesn't make all that much sense...

XML is a wonderful markup where you can describe damn near anything, so it's a good general purpose option. Of course, if it's just a simple list, you could just have a simple text file.

However, why? For reading, anything will do. Are your writing? Is it for a program? If it is for a program, does is make more sense to simply store the data in the program?

Thanks. It actually is for a program. It's a small program where I can insert information or remove it. So I guess it would be changing a lot. I'm thinking about using SQLite. I could use a plain text file, but I wanted to experiment with use some database languages.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1