There is such a requirement:
There are multiple tables on the server, and they all have associated key Content-id.
The previous practice was to:
The front end sends an AJAX request, back-end MySQL according to Content-id, will be a number of tables to do join query, PHP output JSON, and then the front end of the JSON parsing rendering.
But some colleagues say this is too much to consume performance, to change to this:
The front end instead makes multiple AJAX requests, the backend queries each table, each AJAX request corresponds to only one table, no more JSON is join,php output, and then the JSON is parsed and rendered by the front end.
Supplemental Table structure:
Queries for all tables are very simple:
The previous method, just one query:
select * from tableA join tableB on tableB.id = tableA.id ...(可能有多个JOIN)... where id = 5;
To change the method, the previous method has how many tables, this method has how many AJAX requests, there are many times query:
select * from tableA where id = 5;select * from tableB where id = 5;select * from tableC where id = 5;
Which is the better option, please?