views:

492

answers:

2

What, if any, is the performance overhead of using XML as the interface between a Php application (A) and a MySQL database via another Php application (B), rather than direct querying from Php application (A) to the database?

How much will this change between application (A) and the database being on the same server, and being on separate servers?

+2  A: 

There are a number of variables here that would impact performance. Generally the database connection is faster than transmitting and parsing XML, but issues like network latency, message size, and data complexity will all effect how much faster.

On the other hand there are some good reasons to have only one program interacting with the database, like data integrity, that may make the overhead costs worth paying.

acrosman
A: 

XML is a fairly heavy language, in that, there is lots of extra data to convey specific data (ie, the opening/closing tags). This processing is quite CPU intensive, so for larger messages, it can impact performance significantly. If the message sizes are small enough, the performance shouldn't be too bad, you just need to account for what is generating the XML, and what is processing it.

In my opinion, MySQL will be faster, easier to develop, and easier to manage (storing / updating / deleting).

drowe