前端和后端混合还是保持分离。

huangapple go评论72阅读模式
英文:

Front-end and back-end mixing or leave it separate

问题

有2种方法 - 同一服务器或不同服务器。两种方法都可以。

预期:哪种方法是最佳实践,为什么?

英文:

Which is the best practice on the below?

  1. Front-end code running in different server (Nginx or Apache httd server) and Back-end code running in different server (Tomcat Server)
  2. Front-end code and Back-end code running in same port (Tomcat Server). Front-end code moved to static folder in Spring Boot

Thanks

There are 2 approaches - same server or different server. Both will work

Expected: Which one is the best practice and why?

答案1

得分: 1

始终依赖于业务规则:

  1. 在不同服务器上运行具有分布式架构,这将带来更好的单独维护性、弹性和可移植性,但需要更多时间来开发、部署和维护多个服务。
  2. 在同一服务器上运行可以实现更好的服务间通信和更好的整体维护。但是,由于所有系统仅有一个服务,因此韧性较差,如果它关闭,浪费会更严重。

然而,这取决于业务规则。

英文:

Always depends on business rules:

  1. running in different servers comes with distribuide arquitecture that comes with better individual maintain, resilience and portability, but it requires more time to develop and mount and maintaining multiples services up.
  2. running on the same server have better communication beteween services, better integral mantaining. But, it has much less resilience due to has only one service with all the system, if it go off, the waste es worst.

Nevertheless, it up to business rules.

huangapple
  • 本文由 发表于 2023年6月22日 00:55:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76525556.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定