TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

This Microservice Should Have Been a Library

42 点作者 philippta6 个月前

4 条评论

NBJack6 个月前
This feels a bit naive. I won&#x27;t advocate for microservices at all times, but there are additional considerations and caveats<p>Sending multiple requests at once is possible through batching if you want to avoid HTTP overhead. This depends on your threading model, but you can make this semi transparent in the client interface if you wish. Alternatively, use a protocol that supports multiplexing of requests on the same connection.<p>Libraries don&#x27;t work well if your services go past two layers. After this, you start nesting things (library in library), and ownership of an update becomes much more &quot;fun&quot;, especially in an emergency situation.<p>Updates in general with libraries can be easier or harder depending on your deployment model. On one hand, with libraries any tests in your pipeline are going to be more deterministic; you arent as likely to be surprised by behavior in production. On the other, if you have a lengthy deployment process for services and need to plan windows carefully, having a separate underlying service can decouple the process and let you focus on localized changes.<p>YMMV.
andrewstuart6 个月前
Microservices trade development complexity for operational complexity.<p>Write a monolith in Golang with Postgres instead. 99% of ordinary applications would never be able to max out a modern server running this.<p>Microservices are an anti pattern for most ordinary application needs.
评论 #42075898 未加载
评论 #42078268 未加载
评论 #42076103 未加载
评论 #42076042 未加载
评论 #42076387 未加载
cainxinth6 个月前
The “this meeting should have been an email” of software dev.
makoto126 个月前
I agree that microservices need to be considered seriously with real engineering thought and not jumped onto to pad CVs. They are a tool just like anything else, and need to be used carefully. Microservices have a particularly sharp edge.<p>However libraries feel like a very simplistic argument against microservices. In a world where you have a single monolith, then libraries may work fine, but often you have 2, 3 maybe 4 decently sized monoliths. In that situation libraries may not make much sense when you need to reference a central source of data.
评论 #42075999 未加载
评论 #42079900 未加载