(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43515563

一篇Hacker News的讨论帖围绕微服务的缺点展开,起因是一篇题为“为什么我不再和架构师谈论微服务”的文章。评论者们强调了微服务的额外开销,有人估计与简单的函数调用相比,CPU和网络开销增加了1000倍。组织上的复杂性,特别是管理不同端点的团队之间的沟通开销,也是一个重要的担忧,可能还会增加另一个1000倍的成本因素。一位评论者讽刺地将微服务定义为基于武断的架构决策而非实际需求。另一位评论者指出微服务的定义过多,认为这个术语本身可能比有帮助更令人困惑。讨论还涉及到是否应该简单地将HTTP公开的功能视为API,一些人质疑普遍存在的贬低单体架构和微服务的趋势,认为两者根据具体情况都有效,这可能并非软件项目交付时最大的问题。


原文
Hacker News new | past | comments | ask | show | jobs | submit login
Why I'm No Longer Talking to Architects About Microservices (container-solutions.com)
24 points by saikatsg 2 hours ago | hide | past | favorite | 7 comments










Microservices are so expensive in terms of overhead.

Think: how much overhead, one function has in terms of the CPU calling it, then returning it.

How many 1000s of X more are you adding by making that a function inside another webserver.

Yes, there are times when a microservice is correct, there are many-many-many other times where using them is pure waste.



The CPU and network overhead are at least 1000x, but organizational costs are at least another 1000x on top of that (Unless you have a billion users or something, then the organizational costs might be a more manageable 10-100x — Building out fleets of data centers is expensive.)

The organizational costs come from communication overhead between engineers: Sync or maybe async calls within a codebase turn into an ad hoc distributed system, where a different team (and maybe different management chain) owns each network endpoint.



The part about no good definitions of micro-services is a bit far-fetched. I have one that is perfectly functional, though it requires an architect who is enthusiastic about micro-services, hasn't written any code in at least ten years, and who has no operational responsibilities nor experience. Getting one of these is not too hard; they abound. After that minor hurdle is cleared, the test is simple and has two parts: first, the functionality must fit in an ordinary function of some programming language, even Fortran will do in a pinch. Second, the architect has said that this must be a micro-service with its own git repository and independent database. That's it. If these two conditions are met, then this piece of functionality qualifies as a micro-service.


The point isn’t that there are no good definitions. The point is that there are many definitions.

I also have a working definition of a microservice, which is that it is a functional part of a system which exposes its functionality to other parts of the system via HTTP. This works for my team.

In general, we shouldn’t fetishize any particular technology, idea, or phrase. If a term obfuscates more than it clarifies, it’s not very useful.



Wouldn't that be considered an API?


An API is an abstract interface - the "I" stands for interface after all. An implementation of an API can be a microservice.


I certainly don't understand this HN's trend of hating on microservice, and the previous trend of hating monolith. I have worked in both extreme and both works fine. Sure there are things which could be implemented 20% faster with monolith or microservice architecture, but it was never in the top 5 issue that I face while doing software engineering.






Join us for AI Startup School this June 16-17 in San Francisco!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



Search:
联系我们 contact @ memedata.com