/    Sign up×
Community /Pin to ProfileBookmark

Integration data retrieved via webservice query with my own database

Hello,

I have a website that allows users to search [B]stuff in my database[/B] via a web interface.

Now I have the possibility to get more such data from external sources. I also [B]query data from remote servers by consuming web services[/B] when the user searches for something. Now I want to list search results from [B]both the data in my database and the external data I retrieve from the web services[/B] on the webpage if a user searches for something.

I need to order [B]all[/B] the data by price and various other properties, so [B]I want to get the external data into my database as well, but only temporary to answer the a user’s query of course[/B] (it could change on the remote server any time and thus become invalid if it is too old).

[B]What is the best way to store the external data in a way that allows searching and ordering it quickly and easily?[/B]

A temporary table? Insert into my tables and mark records and temporary? Anything else?

Thanks for any hints,

spirit

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 11.2013 — If the sorting is not too terribly complex and you're not talking about too much data (for some undefined value of "too much"), you could just load everything into an array of arrays, and use usort() to sort it as needed. If it's going to be a lot of data (for some undefined value of "a lot"), the temp table strategy might be better, making use of the efficiency of the DBMS's sorting abilities to offset the cost of having to insert that external data into it and then pull it out again (sorted).
Copy linkTweet thisAlerts:
@webspiritauthorNov 11.2013 — The stuff in my database alone is several thousands of records and growing, but the data I get via the web service should be much less (it is from a single company and already restricted to the query parameters).

So maybe I could really just get the best 20 or so from my DB, using its sorting capabilites. The merge with the little data I get from web services and sort again. I'll give it a try, thanks for the suggestion. ?
×

Success!

Help @webspirit spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...