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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

MicroservicePremium

89 点作者 danielalmeida大约 10 年前

8 条评论

benjaminwootton大约 10 年前
I wrote this article some time ago and it has generated hundreds of inbound emails asking me about the risk points associated with Microservices:<p><a href="http:&#x2F;&#x2F;highscalability.com&#x2F;blog&#x2F;2014&#x2F;4&#x2F;8&#x2F;microservices-not-a-free-lunch.html" rel="nofollow">http:&#x2F;&#x2F;highscalability.com&#x2F;blog&#x2F;2014&#x2F;4&#x2F;8&#x2F;microservices-not-a...</a><p>Building Microservices does have a real premium - you are building a complex platform which needs specialists skills and additional work to make happen.<p>The payback of that premium comes later, in the ability to then iterate and change the system easily and quickly.<p>The problem comes when people think they are building an application and not a platform which will support them for the next 5+ years. I try to hammer this point home to our clients who are looking at Microservice architectures.
评论 #9542696 未加载
twotwotwo大约 10 年前
Yao Yu made some observations in her (excellent) talk about caching at Twitter over the years (<a href="https:&#x2F;&#x2F;youtu.be&#x2F;rP9EKvWt0zo" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;rP9EKvWt0zo</a>) that stuck with me: having a bunch of services doesn&#x27;t <i>itself</i> isolate problems within one service. Twitter&#x27;s cache service had to deal with clients rampaging to all load the same key zillions of times, for example.<p>The impression that gives me is that some of the gain from microservices might be from doing all of the things we&#x27;re used to doing at service boundaries: documenting APIs, sanity-checking requests, logging, monitoring availability&#x2F;resource usage&#x2F;other metrics, etc.--the same sort of things any public Web service does knowing it&#x27;s going to have to deal with funny clients, rising and falling load, and so on.<p>If all of the stuff it would take to properly maintain another usable customer-facing service sounds too expensive, that may be a sign that this isn&#x27;t the place to split off a service. But if you find yourself <i>wishing</i> for separate monitoring, a cleaner API, etc. around some part of your system, it becomes more interesting to separate.<p>(I can also buy that some folks can see organizational benefits, or benefits from isolating hardware or making operations async, but separate ideas.)
评论 #9541187 未加载
grandalf大约 10 年前
What is a monolith? Intentionally tightly coupled code that you feel is going to be manageable in the future?<p>I think the biggest anti-pattern is &quot;DRY&quot;. This turns a simple rails view into a monstrosity that is used to render every page of a site, or a class into a self-referencing recursing mind-puzzle.<p>When a codebase starts down the monolithic path, developers will often use the DRY anti-pattern to &quot;shrink&quot; what is actually complexity creep. They will also use another anti-pattern which is using the test coverage percentage as a key metric for deciding what to build&#x2F;improve.<p>Both of these are attempts to fix something that is a far bigger problem: excessive, unnecessary coupling in the core design. This is often because (as others have pointed out) of blind adherence to frameworks and framework &quot;best practices&quot;.<p>In my opinion, the most important metrics are coupling, lines of code (the fewer the better) and readability&#x2F;understandability. Every line of code that you maintain ads a cost to changing&#x2F;improving the codebase (because someone has to understand it in order to change it).<p>If you think of code in terms of its consumers, nearly every API is a micro-service. The less magic&#x2F;faith required by the consumer to use the API, the more effectively it can be used and changed.
评论 #9540417 未加载
timruffles大约 10 年前
Does this feel like backtracking to anyone else? Compare to Fowler&#x27;s previous discussions [1].<p>Maybe it&#x27;s just hard to write about a new, interesting thing without most people getting the impression you think it&#x27;s <i>the</i> way (especially developers, who seem eager to declare any new tool the One True Way® and everything else &#x27;legacy&#x27;).<p>[1] <a href="http:&#x2F;&#x2F;martinfowler.com&#x2F;articles&#x2F;microservices.html#AreMicroservicesTheFuture" rel="nofollow">http:&#x2F;&#x2F;martinfowler.com&#x2F;articles&#x2F;microservices.html#AreMicro...</a>
评论 #9539901 未加载
评论 #9543331 未加载
anezvigin大约 10 年前
I have some experience designing and working on this style of architecture in a non-enterprise non-bigco environment. Some things I learned over the years:<p>1) If the system is young and the team is small, consider imposing constraints onto the system that remove certain classes of problems entirely. You can later lift these constraints as the team grows. [1]<p>2) Your ops environment must be capable of multiplexing multiple services onto the same virtual machine. The way you provision and classify machines is affected by this. Services, by their nature, are small and are likely going to be I&#x2F;O bound. Deploying multiple services onto a single machine is very cost effective.<p>3) If you&#x27;re starting with a monolith, the best early candidates to break off are things like search, graph stuff (eg: Neo4j), recommendations, activity feeds, image processing, and other important but non-critical things. It&#x27;s a great way to drum up support for this architectural style and&#x2F;or test how useful it will really be.<p>4) Unless your engineering team has a polyglot culture (good for you!), be careful about introducing your favorite language when building a new service. Alienating services is a great way for them to rot.<p>5) I&#x27;ve been asked how to define a service. Should X be one service? Should X be split into two services? A good way to start is to think about data locality. When a &quot;user&quot; is fetched are &quot;friends&quot; almost always queried too? If so, keep them together. The next thing to look at are traffic patterns. Another thought exercise is to ask, &quot;if our startup makes a hard pivot tomorrow, what are we likely going to keep? Users?&quot;.<p>6) Do what makes sense. A small startup with a 5 person team doesn&#x27;t need 20 &quot;microservices&quot; to maintain. It&#x27;s an operational burden. Break things away in stages on an as needed basis. I&#x27;ve actually found that keeping around the monolith is a great outlet for rapidly prototyping. Give the monolith a beefy database and an in-memory datastore. When you need to prototype a feature for a week, feed it to the monolith. When it&#x27;s ready for production, break it off if it makes sense.<p>7) If your ops environment is underdeveloped, it&#x27;ll hurt bad. The value of a good ops person cannot be overstated (esp. if you&#x27;re dealing with rapid growth). They&#x27;re wizards. Learn everything you can from them.<p>[1]: I like to impose a constraint that no service is allowed to talk to any other service unless it is: a) customer facing (eg: the website or the mobile api), or b) non-critical and low volume. At first, your services will act as self contained front ends to their databases. Your customer facing applications will stitch together responses from these services (hopefully in parallel). You&#x27;ll have a clear understanding of how data flows in your system.
评论 #9541405 未加载
评论 #9544514 未加载
pacuna大约 10 年前
my question is, what happen is eventually some tools can be useful for overcoming the complexity introduced by microservices (e.g. CoreOS, docker, kubernetes, Netflix OS technology, etc), what could be the argument for not using them instead big monoliths?
评论 #9541242 未加载
评论 #9544546 未加载
commentnull大约 10 年前
I preferred the &#x27;Pattern&#x27; pattern, where each line of code is its own pattern. In fact, I think he writing a whole new book about it now.
strictfp大约 10 年前
Most linux distros can be considered a collection of micro services. The stability vs innovation tradeoffs inherent to this type of systems is well understood, as is the complexity of updating and testing compatibility. I don&#x27;t see why it should be so hard to draw a parallel to microservices.