I have a PHP web service that I am building.
I can for see a problem looming, and would like some input on how to combat it, before I write too much code.
I have 14 sites, which each contain an instance of a mysql database, which is updated by another custom perl script.
In order to consolidate this data into a single web front end, I am attempting to write a php web page that does the following.
On the front page, the web server connects to all 14 database servers and pulls back the information it requires, and then renders it on the page. Currently this works flawlessly as all the data is held on my local machine, but in production this data will be spread across the 14 separate databases.
So my question is, what is the best way to go about abstracting the database reads from the the UI painting. Ideally i would like to have the full webpage render, with a loading bar indicating when the user could expect the data to be displayed.
Is this something achievable via AJAX, or should i be looking in another direction.
Thanks in advance.
I would do something like this:
Eg:
___________________________________
| data_1 | data_2 | data_3 | data_4 |
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
start function loadData1()
will replace data1_id with a loading bar and start AJAX call
___________________________________
| ...... | data_2 | data_3 | data_4 |
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Same for other elements
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With