A vendor is supplying a 1MB XML file that updates every minute. I need to update my database every minute with this information for best results.
The XML file represents a simple flat table structure, which I have duplicated in mysql.
My mysql table contains more data than the XML file (more rows and more columns)… My information must remain persistent despite vendor updates to the data.
Both the XML and the MySQL table share the same key, so there is a clear path to implimenting this update via custom code…
My question is if there are existing libraries or tools that will handle the bulk of this…
For example:
* MySQL functions
* PHP or Perl libraries.
I have tried quite a bit of googling… but my keywords “mysql”, “parsing”, “xml” are so common, that I end up with lots and lots of unrelated results…. Ideas for better search terms would also be appreciated.
When you say you’ve “duplicated in mysql” do you mean that you have stored the entire XML file as-is in a mysql table column? If so, you could try using the MySql XML functions in a stored procedure to process the XML data.
But it would probably be a lot easier to use PHP’s SimpleXML. You’d read the file with PHP, loop through the data in the SimpleXML structure to extract the data you want to update, and then use that to have your PHP update the appropriate rows in your MySQL table.