I am building a React app for a traditional RESTful API server (Golang). The straight-forward approach is easily:
React --> Redux (or any flux) --> Go server
However I'm now thinking of plugging in Node/express as a middle end, so the stack becomes:
React --> Redux --> Node/express --> Go server
The benefits that I can think of are:
The cons are apparent, with the added layer, any requests that eventually go to back-end will take more time back and forth.
I am pretty new to architecture, would be great to know if people are using this extra stack in their production projects? How is the experience?
We are using a similar stack React --> Redux --> Node/express OR Go server
for our application. We sacrificed the additional latency with the proxy node server for the ability to connect with a SSO server (different than our GO server), but also to do server side rendering.
The reason we chose this was because we are a public facing website that allows users to share posts to Facebook. If we didn't have the server side render, we would need to pay for an expensive service like Prerender.io.
The only thing I would propose (which we did) was make SOME calls, like rendering or stuff related to SSO, through the node server, but allow some direct API request go directly to the GO server. Unless you need to do something to each request between GO and React, I recommend this to prevent some overhead.