Should I query and filter on the back-end (Rails API) or front-end (React / Redux)

I have an application that allows users to sort and filter through 30,000 data items. Right now, I am making requests to fetch from Redux actions into my rails API, with requests being processed using the scope methods at my ends of the rails. My instructor recommends that I move all of my requests to my interface for better performance, but I wonder if it would really be more efficient to manage a Redux state object with 30,000 objects in it, each with 50 of its own attributes.

(A few additional notes: right now I am only launching the application locally and I am doing the paginated server page so that it works quickly, but I am a little nervous when I launch it somewhere like Heroku Also, I know that if I will translate my request to the interface, I will have more options for saving the request status in the URL using the agent router, but I already somehow cracked the way with my existing settings.)

+4
source share
1 answer

Let's look at the pros and cons of each approach:

Front Request

  • (+) The request does not require another network request
  • (-) Network requests are slower because there is more data to send
  • (-) An application must store much more data in memory
  • (-) , , , ( ).

  • (+)
  • (+) ,
  • (+) , , .
  • (-)

Back End Front End. . , - Google, Google , , . , .

+4

Source: https://habr.com/ru/post/1695925/


All Articles