On a PHP based website, users will give permission to a Dropbox app to use their Dropbox folder, then the user put thousands of text files in this folder, maybe at once, maybe continuously, which I need to process, save to database and show the results as quickly as possible if the user is logged in to the website (I would like to process and output it nearly real time). What are the best technologies to do this with the least resources ? First, I need to do it for 30 people, but later it has to work with hundreds of users instantly. Each user will have thousand of files, and some files need to process more than once (they are increasing) others don't.
I tought I run a command line php script in a infinite loop, which copy from Dropbox and process files for every user periodically, but it seems too slow. API calls to the Dropbox server seems very slow, so doing it continuously is maybe not the best option.
A better tought maybe the user click on a "Import" button on the website, and the script only get files for those users currently clicked that button.
What's your suggestion ? It doesn't have to be PHP. I have a dedicated server to this, but I would like to hear hosting-friendly solutions too.
Maybe offer me an another simple, secure and fast way to get those files to the server as the Dropbox method. (I choose to do this, because Dropbox is very easy for the user to set up, to use, the sync is very reliable, secure and fast.)