整体式(vs)微服务==>线程(vs)进程 [英] Monolithic (vs) Micro-services ==> Threads (vs) Process

查看:114
本文介绍了整体式(vs)微服务==>线程(vs)进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有5个线程的单进程的整体应用程序.每个线程完成特定的任务.考虑使用泊坞窗将此应用程序移至微服务.如果我看一下架构,每个工作线程将成为一个docker进程.因此,就我而言,整体与微服务在某种程度上更像是线程与流程的讨论.

I have a monolithic application with single process having 5 threads. Each thread accomplishes certain specific task. Thinking to move this application to microservices using dockers. If I look at the architecture, each worker thread would become a docker process. So, in some way Monolithic vs Microservices becomes more like Thread vs Process discussion in my case.

拥有单片芯片的最初想法是拥有用于性能的线程并共享相同的内存.现在有了微服务架构,从性能的角度来看,我被推到了一个可能不适合的流程模型.

The original thinking of having the monolithic was to have threads for performance and share the same memory. Now with microservices arch, I am pushed to a process model that may not suit from performance point of view.

对于解决这个问题,我有些固执.

I am kind of stuck on how to approach this problem.

推荐答案

您在这里缺少的是微服务不适合世界上任何软件系统!在做任何事情之前,请考虑一下将当前的单片系统迁移到微服务的驱动程序.您是否正在寻求高可用性和可扩展性?您是否想自由使用不同的编程语言编写每个线程?您的系统是否如此复杂,以至于无法以整体风格理解?最后,您准备好支付拥有微服务风格的费用了吗?

What you are missing here is that microservices is not suitable for any software system in the world! Think about the drivers for migrating your current monolithic system to microservices before doing anything. Are you seeking for high availability and scalability? Do you want to have freedom for writing each thread in different programming languages? Is your system that complicated that could not be comprehended in a monolithic style? and finally, are you ready for paying the expenses of having a microservices style?

微服务会给系统带来很多复杂性,并可能由于服务的闲聊而导致性能下降,而有利于更高的可伸缩性.如果性能是一个重要的问题,那么系统不是那么大,并且您对上述大多数问题的回答为否",我强烈建议您不要采用微服务风格.相反,请尝试模块化您当前的代码库并重构代码,以提高质量和易理解性.

Microservices brings in many complexities to the system and may cause performance penalties in favor of higher scalability due to chattiness of services. If performance is an important concern, the system is not that large, and your answer to most of the above questions is "NO", I strongly suggest that you do not go for microservices style. Instead, try to modularize your current code base and refactor the code for better quality and comprehensibility.

关于Docker,您甚至可以使用整体样式来使用它,以消除开发和部署环境中的某些部署障碍和不一致之处.如果提到的有关部署的问题不会打扰您,也不要选择docker,因为这只是计算开销的一部分.

Regarding Docker, you can use it even with the monolithic style in order to remove some of the deployment barriers and inconsistency in the development and the deployment environments. If the mentioned issues around deployment do not bother you, do not go for docker either since it will be just a layer of computational overhead.

这篇关于整体式(vs)微服务==>线程(vs)进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆