简体   繁体   English

如果我有一个 React 前端和一个微服务后端,我可以有两个部署目标(S3 用于前端,EKS 用于后端)吗?

[英]If I have a React frontend and a microservices backend, can I have two deployment targets (S3 for frontend, EKS for backend)?

Having built a static frontend, my thought was to deploy this to a static assets server like S3, while deploying my microservices backend using kubernetes to a compute service like EC2 or EKS.构建了 static 前端后,我的想法是将其部署到 static 资产服务器(如 S3),同时使用 kubernetes 将我的微服务后端部署到计算服务(如 EC2 或 EKS.

However, my research has only turned up one approach: building the frontend as a service in my kubernetes cluster.然而,我的研究只发现了一种方法:在我的 kubernetes 集群中构建前端作为服务

My questions:我的问题:

  1. Is it possible to have two deployment targets like my thought above?是否有可能像我上面的想法一样有两个部署目标?
  2. If possible, what are the pros/cons to doing so (in particular, will communication between frontend & backend be tricky?)如果可能的话,这样做的利弊是什么(特别是前端和后端之间的通信会很棘手吗?)
  3. Are there any other deployment approaches to consider besides these two?除了这两种之外,还有其他需要考虑的部署方法吗?

For additional context, my frontend is a React app built through create-react-app, and I've already extracted by production build.对于其他上下文,我的前端是通过 create-react-app 构建的 React 应用程序,并且我已经通过生产构建提取了。 My backend comprises of several NodeJS microservices.我的后端包含几个 NodeJS 微服务。

Is it possible to have two deployment targets like my thought above?是否有可能像我上面的想法一样有两个部署目标?

Yes, it is possible.对的,这是可能的。

If possible, what are the pros/cons to doing so (in particular, will communication between frontend & backend be tricky?)如果可能的话,这样做的利弊是什么(特别是前端和后端之间的通信会很棘手吗?)

In the case of a static frontend, the browser (client) talks to the backend, as long as the user is able to communicate with the backend, everything should be fine.在 static 前端的情况下,浏览器(客户端)与后端通信,只要用户能够与后端通信,一切都应该没问题。

Are there any other deployment approaches to consider besides these two?除了这两种之外,还有其他需要考虑的部署方法吗?

You can deploy your frontend anywhere, you can check out other options like https://www.netlify.com/ and https://vercel.com/您可以在任何地方部署您的前端,您可以查看其他选项,例如https://www.netlify.com/https://vercel.com/

This article should give you a better understanding of Kubernetes with similar architecture https://www.freecodecamp.org/news/learn-kubernetes-in-under-3-hours-a-detailed-guide-to-orchestrating-containers-114ff420e882/这篇文章应该可以让你更好地了解 Kubernetes 架构类似https://www.freecodecamp.org/news/learn-kubernetes-in-under-3-hours-a-detailed-guide-to-420A1C4B6A7110B50D807BADE5Z /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在后端和前端上传到s3 - Attempt to upload to s3 on backend and frontend 我有一个 NodeJS 后端我正在开发与 ReactJS 前端一起工作,但我不断收到 500 错误 - I have a NodeJS backend I am developing to work alongside a ReactJS frontend but I keep getting a 500 error 是否有可能在Haskell中编写后端并使用Javascript进行前端编写? - Is it possible to have backend written in Haskell and frontend with Javascript? 我可以在前端使用后端的OAuth令牌吗? - Can I use an OAuth token from backend in my frontend? 如何将Vue.js前端与Java后端连接? - How can I connect a Vue.js frontend with java backend? 无后端的 React 前端通信 - React frontend communcation without backend 使用 Express 后端重定向 React 前端 - Redirect React frontend with Express backend 使用 Flask 后端和 React 前端登录 - Login with Flask Backend and React Frontend 如果我在前端使用 vanilla js 而在后端使用 node.js,如何在同一端口上运行前端和后端? - How to run frontend and backend on same port , if I am using vanilla js on frontend and node js on backend? 我可以在同一个文件结构中同时运行我的 Node.js/Express 后端和 React.js 前端吗? - Can I run my Node.js/Express backend and React.js frontend together in the same file structure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM