I have two main data sources I need to do a mashup with in php. The first one is an SQL database and the other is a feed. Both sources contain similar items that need to be sorted by "name" or "weight". There are more than 1k items in each of the sources. Simply storing the feed in the db is not an option, as the feed changes far too often.
What I want to achieve is an accurate paginated output of the two. For example: if I display page two of the results containing 50 items sorted by "name" I don't read all data from feed and database but only the necessary items from both sources.
I currently assume this requires the database data to be fundamental data and to somehow merge the feed data into it, but: 1) I may be wrong, 2) I cannot seem to get my head around this no matter how hard I seem to try.
Any suggestions on how to achieve this?
P.S. The results do not have to be completely accurate. They only have to seem like it.