I am along the way of creating a little website and was curious when an XML file can/ought to be replaced for any database table. You will find certain cases where I believe utilizing a database table might be overkill and only agreed to be wondering if other people originates across causeing this to be decision.


If you feel you'll finish up requiring greater than a small quantity of CRUD, or perhaps your site will grow beyond a few customers, make use of a database.

Searching or upgrading XML files can kill performance and future scalability.

I'd go for using database tables when concurrent creates can happen, i.e. in almost any situation whenever you cannot guarantee that merely a single switch to the information may happen at anyone time.

Further, when the information is relational, I'd make use of a database.

For small things that could be low traffic, XML is okay.

IMO: Make use of a DB when you will have many write transactions for your data. If you're mainly writing a config type document, something mostly read only, go XML. XML like a datastore isn't your very best solution as you will have far better results utilizing a DB. Especially when you start getting many records(rows), a DB starts being simpler to utilize.

Think about the character of the data, and limits your computer data storage imposes in your data. In case your data resembles records instead of documents, having a regular structure and little hierarchy, and possibly many horizontal relations among data elements, then generally you're going to get better performance and robustness having a RDBMS compared to some type of native XML storage. In case your data takes the type of documents, with irregular consecutive structures and indefinite hierarchies, you'll most likely 't be very heppy modeling this data inside a RDBMS, and you'll desire to explore native XML datastores. Open-source good examples include

Commercial XML databases include

I haven't used these items myself yet.

Either in situation, you should use XML like a data interchange format.

I disagree with Stephen. Databases ought to be used particularly when discussing data among programs is an issue.

Databases are for discussing data. That is what these were invented for, and that is what they're proficient at. Even just in situations where concurrent update isn't at problem, databases tend to be more formal than XML files. And XML's informality is tempting in the start, but ultimately results in unusability.

Although it can be hard to resolve the impedance mismatch between some programs and also the relational type of data and/or even the SQL interface, will still be the situation that you simply gain in in versatility and stability than you need to do with XML.

I'd reserve XML for situations where formal data analysis is in some way inappropriate, or formal database design is past the achieve from the team of developers.

You should use XML if you're not likely to mage many changes with records (for labels, config etc.) otherwise it's appropriate to make use of tables.

I design my tables and generate XML document with choose qualities (FOR XML).

I believe basically stumbled upon a performance problem, I'm able to change my repository with DB.

It's easier to do changeable design if performance problem or etc happens.

XML ought to be employed for data-transfer - ie, moving data between programs (once the other applications can't touch the database for reasons uknown).

There's [barely] ever grounds to NOT make use of a database for driving an internet site, however.

You could also think about a hybrid approach, like this utilized by Grain University's Connexions project: they will use Plone (along with other stuff on the top from it) to provide data using their database that has been produced within the CNXML dialect.

I am dealing with a credit card applicatoin that actually works with 100% XML for data storage at this time. The reason behind this really is permitting text searching in several other programs. Sometimes XML is much better when you really need to talk about data in other programs.