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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: How microservices works?

13 点作者 CCing大约 8 年前
Stupid question: how exactly works microservices ? how they comunicate between different apps&#x2F;languages ? they use rest api or is better use something like zeromq&#x2F;rabbitmq ?<p>Sorry to post this here, but honestly I often hear about microservices but I don&#x27;t really understand what they are.<p>Any good link&#x2F;book&#x2F;slide is welcome.<p>PS: I will appreciate some examples in real world by big companies(example: how they do in airbnb&#x2F;uber&#x2F;whatever ?)

9 条评论

imauld大约 8 年前
Very good read that gives a pretty high level description of services:<p><a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Building-Microservices-Designing-Fine-Grained-Systems&#x2F;dp&#x2F;1491950358&#x2F;ref=sr_1_1?ie=UTF8&amp;qid=1488268723&amp;sr=8-1&amp;keywords=building+microservices" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Building-Microservices-Designing-Fine...</a>
brudgers大约 8 年前
There are two related questions:<p>1. What is a micro-service?<p>2. How is a micro-service architecture implemented?<p>The first is subject to some debate, and it&#x27;s not a debate I&#x27;m particularly interested in so I&#x27;ll leave it as an exercise.<p>Micro-service architectures are generally implemented in two ways: push and pull. A collection of REST API&#x27;s will tend to produce a push architecture of explicit requests and responses. A log to which all requests and responses are written with each individual service responsible for finding applicable messages is a way of implementing a pull architecture. Queues can play a role in either but are at an implementation detail at a lower level of abstraction.<p>Chat bots [1] can be seen as an example of a pull architecture with a log. Bots scan the continuous stream of messages and ignore what does not apply and act upon what does apply, typically they return results to the message stream. A chat bot might have a queue to manage requests and responses (input&#x2F;output) or not, but that&#x27;s an implementation detail not a high level architectural one at the level of a chat system.<p>A chat system will tend to grow by adding more bots rather than expanding existing bots and each bot will tend to have little or no knowledge of other bots. Each bot will be independent: one will run Jenkins another will make coffee.<p>The big point is that services are a way of organizing a system architecture and micro-services are one granularity at which the system may be decomposed. It&#x27;s probably arguable that what constitutes a micro-service versus a service is relative to the size of the overall system. In practice, what is and isn&#x27;t a micro-service has some correlation to the practicality of delegating responsibility to a team &lt;= two pizzas.<p>YMMV.<p>[1]: A chat bot might be an example of something that is small enough to be &#x27;micro&#x27;-- or deci, nano, atto, yocto etc. -- (or not).
rgovind大约 8 年前
Lets say you have an ecommerce firm. When a user is browsing an item(diapers?), at a mimimum he&#x2F;she expects to see images, description, reviews, cost, tax, delivery dates, promotions, related items. In addition to what you see on frontend, in the backend, there may be jobs run for analytics, revenue reconciliation, warehouse management optimization, carrier management, fraud checks, item data setup and a host of other activities. Each of these tasks has its own complex business logic and typically has its own team. Each team runs a service, possibly in the form of a REST API call. You can call them microservices.
dozzie大约 8 年前
&gt; how [microservices] comunicate between different apps&#x2F;languages ? they use rest api or is better use something like zeromq&#x2F;rabbitmq ?<p>Everything you mentioned, and then several other mechanisms. Whatever happens to be fashionable where they are being implemented.<p>&gt; Sorry to post this here, but honestly I often hear about microservices but I don&#x27;t really understand what they are.<p>A bunch of small applications running separately that talk to each other using different protocols (sometimes one of the RPC protocols, sometimes raw HTTP that is today called REST, sometimes ZeroMQ or AMQP or some other ESB). The idea has little more in it than this, though operationally there are still some things to figure out.
评论 #13739607 未加载
z3t4大约 8 年前
Here&#x27;s a good talk that, while it mentions how Amazon use micro-services, it&#x27;s very broad, and will probably leave you with more questions then answers: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;6K4ljFZWgW8?list=LL9RQYUX_WIjk8SAcyuarJEw" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;6K4ljFZWgW8?list=LL9RQYUX_WIjk8SAcyuarJEw</a> (The Future of Software Engineering • Mary Poppendieck)
zhangxd6大约 8 年前
I would strongly suggest to read the book &quot;Building Microservices&quot; by Sam Newman. He gave fair good description of what it is and what are the considerations you need to think when build it.
z3t4大约 8 年前
for example. a calculator as a service. where users can add substrct divide and multply. devision turns out to be most in demand and is thus turned into its own service with separare hardware and team.
ceracm大约 8 年前
Take a look at <a href="http:&#x2F;&#x2F;learnmicroservices.io" rel="nofollow">http:&#x2F;&#x2F;learnmicroservices.io</a> That has links to numerous resources including some introductory articles.
z3t4大约 8 年前
they can be compleatly isolated. and are often used as a scale out strategy. or an optimization where a botleneck is taken out from a monolith so it can scale independenly.