matt
matt

Reputation: 821

Is it a good idea to use XML files to present data that is not updated often? VS MYSQL query

I'm building my website and I'd like to limit calls to my MYSQL database.

One idea I have is to use XML files to present information that does not need to be updated as regularly as every page load.

Two example are

  1. Site navigation which might only change once a week.

  2. The number of items in stock which will in most situations only need to be updated when an item becomes out of stock.

I have a feeling this is a good solution, however my experience with XML is quite limited, so I'd like some feedback before delving into it.

Many thanks.

Upvotes: 0

Views: 101

Answers (3)

Guillaume
Guillaume

Reputation: 18865

If you want to use XML for performance reasons, don't do it. Use cache instead, as Märis suggested. If you want to use XML because it is a better primary representation of your model, than by all means, do it ! Be aware that there is a few problems you will have to solve (concurrent edits on your XML files for example).

XML can be a better format to store hierarchical data than a relational database, like your navigation.

Upvotes: 0

daniel
daniel

Reputation: 3174

This might be a good aproach.

Supplying your xml-Files with E-tags forces the Browser to do the caching. So even your Webserver requests could be handled faster.

Upvotes: 0

Māris Kiseļovs
Māris Kiseļovs

Reputation: 17295

Just use memcache, xcache or any other caching solution to cache your SQL requests.

Upvotes: 1

Related Questions