O
O
OlegCinema2020-04-14 14:54:28
React
OlegCinema, 2020-04-14 14:54:28

How to use React in production?

Hello. I'm trying to find an answer to my question. What is the best way to organize the work: completely separate the frontend and backend and put them on different web servers, or still tie the react frontend to the backend? Which approach is better? And why? Help me please.

Should I do SPA with React, and do interaction with the server through REST?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dasha Tsiklauri, 2020-04-14
@dasha_programmist

divide by two - API + SSR is more flexible in terms of independent development and scaling (for example, SSR requires 5 instances, while API may need less)
if you combine everything into one, it turns out to be less flexible, but gain in development speed (most likely, but it depends on the tools inaccurately)
an example of the possibility of next.js is that it is possible to combine both api and CCP into one application, but is it worth it?

F
foterio, 2020-04-15
@foterio

Usually I always do back-end and front-end on different instances. In the future, it's easier to scale in case of increased load, just add more memory / cores.
On each server, using PM2, you can deploy multiple node clusters. Plus, if you add memcached, there will be fire at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question