1

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:

  • Server side rendering
  • Faster form validation
  • Wash the data before sending off to Go API, with numerous amazing node packages
  • Manage authentication and sessions easily

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot, that's really good tip! I thought about separating calls by their nature, but always wondered if it would be a hell for maintenance later on. Should be interesting to try it out.
Not if you treat it like an API and the node server as another API. But it can always become an issue, so it is something to think about

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.