《microservice design》

一、原文:

There is an important issue to note: although it is possible to create modules with good isolation within a single process, I rarely see people who can truly achieve this. These modules often quickly become tightly coupled with other code, losing their original purpose. In contrast, the existence of process boundaries can effectively prevent this from happening (or at least make it difficult to make mistakes). While I don't believe this is the main reason for using process isolation, in reality, few people are able to achieve good module isolation within the same process.

Apart from dividing the system into different services, you may also want to use modules to partition within a single process. However, relying solely on module partitioning does not solve all problems. If only Erlang is used, it may take a long time to truly achieve good modularity, but I doubt that most people would do so. For the remaining people, the benefits provided by modules are similar to those of shared libraries.

二、翻译:

有一个重要的问题需要注意:尽管在一个单一进程中创建具有良好隔离性的模块是可能的,但我很少见到真正能够做到这点的人。这些模块往往会迅速与其他代码紧密耦合,从而失去了原本的意义。相比之下,使用进程边界可以有效地避免这种情况的发生(至少很难出错)。虽然我并不认为这是使用进程隔离的主要原因,但实际上很少有人能在同一个进程内部实现良好的模块隔离。 除了将系统划分为不同的服务,你可能还希望在同一个进程内部使用模块进行划分。然而,仅仅依靠模块划分并不能解决所有问题。如果只使用Erlang,可能需要很长时间才能真正实现良好的模块化,但我怀疑大多数人都没有这样做。对于剩下的人来说,模块提供的好处与共享库相似。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值