I am building a Flex application using Pure MVC pattern and Zend framework for calling php code on the server. I need to sync some data with my server which is using MySQL as the database. And there are 5 such tables I need to sync. So I call these php functions at regular intervals from Flex and use long polling on php side. The client side code for my subjects lies in 5 different proxies. Here are my questions:
Should I send 5 separate requests from each proxy to call the php code which is lying in separate classes. Or should I build a separate proxy to send 1 request from 1 php file and then distribute this data among different proxies on the client side. Which one will be more effecient? Mathematics shows using separate proxies and php classes allow more number of users to be accomodated on the server.
Can I write 1 SQL command to fetch data from all 5 tables given they cant be joined on any column?
Here is my 2 pence...
I'd use one request, using multiple requests is not necesscary seen as one response can contain all of the data you want to be returned. Doing multiple requests could vastly increase the time it takes to sync the tables because there can be a lot of overhead associated with a single request.
I am not aware of being able to pull data from multiple tables without a
JOIN, you'd probably need 5 different
SELECT queries or use sub-queries. Perhaps Google it?