I understand that they are needed to dynamically update the data in the house, but this requires an array of data, and getting them using Ajax quite problematic. In my opinion it is easier to make a conclusion via php , where you can immediately contact the database. If so, then why?

Closed due to the fact that the question is too general for the participants Sasha Omelchenko , Bald , Grundy , Vladimir Gamalyan , vp_arth 7 Mar '17 at 9:04 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    Separating an application into a client and a server has many advantages. - vp_arth
  • I advise you to learn more about the concept of Single-Page Application and rendering on the user side. Such frameworks are needed precisely for this. It is assumed that a substantial part of the computational load relating to user interaction falls on his browser. While the server remains to work with the data. - iTollu

1 answer 1

When outputting via php, all the markup will be generated on your server, and if the user wants to get more data, he will have to refresh the entire page. If the user performs some action on the page, he will again have to refresh the entire page. Libraries like React allow you to create dynamic and interactive user interfaces, again, getting data from ajax is not at all problematic, such libraries and frameworks are sharpened by this. In this case, you separate the Frontend and Backend into independent units that can communicate via api. So the answer is that with React-type libraries, it is much easier to develop and maintain user interfaces, where you don’t have to update the whole page for any reason. And second, on the server you work only with data and do not generate markup, which has a positive effect on server performance.