Question

what you think is better? store xml files on a database (sql) vs on a file server?

some consideration:

*there will be a great number of new files (> 800 per day)
*much more reads than writes, let say 5-10 per every new file
*and almost no updates or modification on the files once created

Im interested on knowing the pros and cons of each approach related whit performance and security and any other usable information that u culd give me.

tks

Was it helpful?

Solution

A lot depends on what you want the database or the file system to do with the XML.

It sounds as if you mainly just want to store them by name or number, and get them back. That is, the database or file system doesn't have to search within them, index them by several different properties, retrieve parts of them rather than whole files, etc.

If that's the case, then it's pretty much the same tradeoffs as with anything else: "should I store my JPEG files in a database or in the file system"? A few of the tradeoffs are:

  • If you go over about 1,000 files in a single directory, many files systems slow down badly. Of course, you can organize them into various directories (Git and iPhoto do this simplistically but effectively).

  • Do you need to worry about replication, fail-over servers, and other hi-load issues?

  • Do you need to worry about transactions (say, two people trying to add or replace the same file at the same time), user permissions, transaction logging, the ability to roll back to how the system was last week, and such?

Complexities like those probably argue for using a database, since databases generally have features specially designed to help with those kinds of issues. If it's just store and retrieve of entire XML files, filesystems may be easier.

In either case, if you can make the rest of your system not care, that's better. That is, isolate the part of the system that actually talks to the database or the file system, so you can plug in either one as needs change.

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top