每日阅读——《微服务设计》

一、原文:

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,可能需要很长时间才能真正实现良好的模块化,但我怀疑大多数人都没有这样做。对于剩下的人来说,模块提供的好处与共享库相似。

你可能感兴趣的:(微服务,架构,云原生)