I got 2 tables in mySQL database:
Persons:
id name address .....
and Items:
id person_id param1 param2 ....
items are referenced by person_id to Persons. There is about 5000 persons and 40,000 items and growing. This data need to be updated every few days from big XML file what look like this:
.....
<person id='100016' lastname='....' firstname='.....' .... >
<item param1='...' startdate='2006-01-07' enddate='2006-12-09' ... />
<item param1='...' startdate='2007-01-04' enddate='2007-12-08' ... />
<item param1='...' startdate='2008-01-04' enddate='2009-01-03' ... />
<item param1='...' startdate='2009-01-06' enddate='2009-12-31' ... />
</person>
......
Some attributes of person and item can change, new persons, and new items could be added.
What is best way to keep it easy to update ? I do not think that truncating tables and loading them again would most effective way. Should I consider some staging - size of XML file start to have meaning 60MB and growing -> it not effective to have it parsed to SimpleXML and comparing with SQL...
What would be a best practice in situation like this ?
I have mySQL and PHP with Zend Framework as my environment