TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Disasters I've seen in a microservices world

256 pointsby gregdoesitalmost 4 years ago

22 comments

throwawaaarrghalmost 4 years ago
In the modern world of computing, the one thing I have seen literally everywhere I&#x27;ve been is people implementing systems that they absolutely do not understand.<p>Most microservices I&#x27;ve seen implemented are not actually microservices. Most teams (unless they are developing &quot;simple&quot; web or mobile applications) have no idea who is consuming their services, or how, or if what they&#x27;ve made is working correctly. They frequently don&#x27;t have an understanding of the different models of releasing software, much less of a complete system architecture, failure modes, consistency models, reliability estimates, performance limits, etc. Mostly what I see time and again is a team of people who just write some code that seems to work for them, and then go home, without ever considering how or if it&#x27;s working in the real world.<p>I don&#x27;t know anything about modern computer science education. But it appears that new developers have absolutely no idea how anything but algorithms work. It&#x27;s like we taught them how hammers and saws and wrenches work, and then told them to go build a skyscraper. There are only two ways I know of for anyone today to correctly build a modern large-scale computer system: 1) Read every single book and blog post, watch every conference talk, and listen to every podcast that exists about building modern large-scale computing systems, and 2) Spend 5+ years making every mistake in the book as you try to build them yourself.<p>It feels like the industry mostly just re-learns the same mistakes over and over like we&#x27;re in Groundhog&#x27;s Day (we&#x27;re the extras, not Bill Murray). But it&#x27;s equally possible that I just lack perspective and am expecting too much. Maybe the auto industry at the turn of the 20th century also spent decades re-learning the same lessons over and over, as the novelty of mass-producing complex systems continued to elude us. Hell, the new auto companies <i>still</i> don&#x27;t get it right.
评论 #27498747 未加载
评论 #27498683 未加载
评论 #27498802 未加载
评论 #27498725 未加载
评论 #27498723 未加载
评论 #27499485 未加载
评论 #27498823 未加载
评论 #27512340 未加载
评论 #27512792 未加载
deckard1almost 4 years ago
I was going to comment on this very thing in the other thread about software glue[1]. In that article there is a youtube video on Multics vs Unix[2] which really outlines why microservices were always doomed.<p>Someone should coin a new law for how programmers have to rediscover Brooks&#x27;s law every 5-10 years. The issue with microservices, as it has always been, is that you need an <i>enormous</i> company to brute force the communication pathways and maintenance overhead for it to all work. And by work, I don&#x27;t mean function efficiently (as the Multics vs Unix video shows). I mean <i>just function</i>. Just work at all. The Multics team had all the devs and the Unix team was two guys doing laps around the Multics team. Because they had the mathematics on their side.<p>Remember the bad old days of memory thrashing? That&#x27;s what happens to teams that do not have enough bandwidth to properly maintain the dozens of services they are responsible for. Your organization gets frozen.<p>This is what we all get for taking advice from the Googles and Facebooks of the world. Google has like a billion lines of code in a monorepo. They do not do things remotely like 99% of the businesses out there. They are sitting on huge piles of money that lets them be incredibly inefficient <i>for decades</i>.<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27482832" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27482832</a><p>[2] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=3Ea3pkTCYx4" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=3Ea3pkTCYx4</a>
评论 #27499441 未加载
评论 #27501214 未加载
jillesvangurpalmost 4 years ago
People do microservices for the wrong reasons. There are only a few somewhat valid reasons:<p>1) something has different run time needs than something else. Think CPU, memory, network. Breaking stuff up allows you to make different choices here. Although I have dodged this by simply deploying the same monolith and configure it to do different things.<p>2) Something needs to be developed by a different team and for whatever reasons you don&#x27;t want those teams to be too dependent. It&#x27;s a bad reason but it&#x27;s valid in a lot of companies where certain teams just need to be engineered around or where there is a fundamental lack of trust between different parts of the org chart. Conway&#x27;s law is a thing. It&#x27;s the most common reason to do micro services.<p>3) You have two things depending on each other (cyclical dependency) and you want to reuse that thing. Extracting it to a third thing is a common way out. It&#x27;s true for almost any component technology. If you have two components, you&#x27;ll find a reason to create a third. And a fourth. And so on. However, consider using something less dramatic. E.g. code libraries are a valid choice. Or having an extra module in your source tree.<p>Everything else is just needlessly&#x2F;prematurely increasing overhead, deployment friction, etc. You get more things to monitor, deploy, manage the roadmap off, worry about, specialize in, etc. Big bloated organizations do micro services because they are big and bloated. Many smart startups keep this nonsense to a minimum. Of course some startups start out being over funded and bloat too early. VC money is great and sometimes requires over engineering like this (i.e. impress the suits). I&#x27;ve heard more than a few CTOs boast their multi cloud strategy and micro service architecture. In my mind that translates to we funnel a lot of VC money to Amazon and pay people full time to do just that. Ridiculous monthly bills and no users or traction is a common pattern in that world.
评论 #27494019 未加载
评论 #27494179 未加载
评论 #27494079 未加载
评论 #27497948 未加载
jaredcwhitealmost 4 years ago
The problem with the hype around microservices was that it&#x27;s the web app deployment equivalent of writing device drivers in C. Sure, some people can do it. Some people <i>have</i> to do it. Yet most people shouldn&#x27;t even make the attempt.<p>I&#x27;ve been on teams where we can&#x27;t even reliably deploy code over time to <i>one</i> service. The idea of our team maintaining multiple services is madness. That&#x27;s not a knock on any individual&#x27;s technical merits. Deploying code to the cloud is just hard, period—and that&#x27;s even when talking about a traditional monolith!<p>I&#x27;m glad the pendulum is swinging back. The microservices pattern is useful for the areas in which it&#x27;s useful…it just so happens that problem space is <i>way</i> smaller than the hype cycle cared to admit a few years ago.
评论 #27496997 未加载
评论 #27500538 未加载
评论 #27498988 未加载
kevmo314almost 4 years ago
&gt; Some teams were suffering from servicitis. Even worse than that, it generated a lot of friction while developing. One could not just look into a project in their IDE, but it required to have multiple projects open simultaneously to make sense of all that mess.<p>This is real: I&#x27;ve worked in projects where purely transformational code was offloaded into a &quot;service&quot;. Refactoring it into a library reduced lines of code, computational cost, and code complexity dramatically.<p>But wouldn&#x27;t it be cool if there were a framework where the developer didn&#x27;t have to demarcate where services started and ended? In principle, any pure asynchronous function could be abstracted out to a service. It would be neat if the compiler did that for me and deployment of the application was more like &quot;deploy the cluster&quot; instead of deploying each individual service.
评论 #27493525 未加载
评论 #27493383 未加载
评论 #27493359 未加载
评论 #27494707 未加载
评论 #27498539 未加载
评论 #27496742 未加载
spaetzleesseralmost 4 years ago
I recently got talked into developing a new project with Kubernetes and microservices. It&#x27;s an interesting journey but the complexity this adds is just enormous. Debugging is hard, refactoring is hard once it touches service boundaries, coordinating releases between services is hard and so on. I highly doubt that we will ever scale to a size where the complexity pays off.<p>I feel this kind architecture of especially appeals to people who like to write only new code instead of understanding existing code. They don&#x27;t like to read old code to see where new functionality may fit in so they spin up new services.<p>We are complaining about maintenance of old COBOL code but God be with the poor people who in 20 years will have to maintain the monstrosities we are creating today.
评论 #27495280 未加载
cratermoonalmost 4 years ago
&gt; Timeouts, retries, and resilience<p>At a previous employer I was responsible for a critical service that was starting to show strain as traffic ramped up. It used Hystrix as the circuit breaker for calls to backend services, including the DB, and at peak times the thread pool would fill and start rejecting additional requests. I was tasked with fixing that.<p>There&#x27;s a very simple formula for tuning the number of threads:<p>&gt; requests per second at peak when healthy × 99th percentile latency in seconds + some breathing room<p>The catch is that getting good RPS and latency numbers is in a distributed system deployed across three geographically separated datacenters is the opposite of simple. In particular, the legacy of the system meant that we had one write instance of the DB, in one datacenter, meaning that latency was different depending on which DC was the source of the call, so there was no one setting that worked for all instances.
sackerhewsalmost 4 years ago
I was once working with an engineer so hell bent on splitting everything up into microservices that at one point logging became incompatible with his solution.<p>He then argued that our banking solution didn&#x27;t need logging, because it was so well tested that failure rates would be extremely low.<p>I&#x27;m not making this up.
e67f70028a46fbaalmost 4 years ago
Putting a network connection between your application abstractions was always a dicey proposition. (See EJB 1.0)<p>Making it the entire basis for application abstraction is lunacy, the sort of extremely clever idiocy that can only occur in the tech world.
评论 #27495163 未加载
评论 #27498359 未加载
评论 #27498433 未加载
slveralmost 4 years ago
Disaster #1 is too small services, and Disaster #4 is huge, shared databases (between many services).<p>Which reaffirms my overall opinion that most people writing services have no idea what&#x27;s a service and what it encapsulates (it encapsulates its own state, for example, it&#x27;s basically distributed OOP).<p>BTW, remember when &quot;your service should be 100 lines of code top&quot; was considered a best practice?<p>Why is it so hard for most to resist this hype nonsense wave when its oncoming and it&#x27;s so hard to resist the anti-hype wave that inevitably follows it? Because hype and anti-hype are simply the oscillation of a sea of empty minds in look for a solution to a problem they don&#x27;t understand.<p>I&#x27;ve been writing service oriented apps for decades. In my &quot;world&quot; nothing has changed.
评论 #27493441 未加载
评论 #27495481 未加载
评论 #27494952 未加载
aprdmalmost 4 years ago
Really good write up! I think the suite spot in a &lt; 50 eng organization is either a monolithic or a microservice per domain (instead of per functionality)<p>Once you have thousands of engineers, then you either need extreme discipline and a huge team maintaining the &quot;devops&quot; pipeline that everything goes through, or, it&#x27;s basically everyone for themselves and a &quot;devops&quot; team trying to help others setting standards, best practices and whatnot.
FpUseralmost 4 years ago
In places where micro&#x2F;services were *really* needed people&#x2F;orgs were implementing those even decades back. I personally was doing it in the 90s. For myself the criteria for making something as a service was simple: it will really cost the organization not to have it as a service.<p>Now as with many things that nothingburger got suddenly overhyped and ended up being shoved into every hole disregarding of any technical rationale.
trixie_almost 4 years ago
Another one for <a href="http:&#x2F;&#x2F;microservices.fail&#x2F;" rel="nofollow">http:&#x2F;&#x2F;microservices.fail&#x2F;</a><p>There are so many developers who think microservices are the answer to every ill in the world it is infuriating. It’s like one of those ‘nosql is webscale we should use it’ conversions.
helge9210almost 4 years ago
&gt; I&#x27;ve seen many engineers ignoring these because it&#x27;s &quot;an edge case&quot;, to realize later they have a massive data integrity problem.<p>Massive optimism detected at the part of &quot;to realize later&quot;.<p>Also, if you have &quot;edge case&quot; with high (close to 1 but lower than 1) probability of successful outcome, with more and more tries probability of all outcomes being successful moves to zero (multiplication of lower than 1 values) and probability of at least single failed outcome goes to 1 (addition of lower than 1 values). You still have to handle low probability edge cases.
tjpnzalmost 4 years ago
The E2E testing one is driving me nuts. I&#x27;ve told people time and time again that we&#x27;ll never be able to have hundreds (or even a dozen) of them working reliably. Yet people still try and to date we&#x27;ve lost even more hours in trying to make them reliable. The idea is seductive but in my experience an exercise in futility. At the same time I&#x27;ve proposed alternatives such as semantic monitoring but people typically recoil in horror when they learn what it means.
评论 #27498852 未加载
mavelikaraalmost 4 years ago
A response someone wrote to this article: <a href="https:&#x2F;&#x2F;medium.com&#x2F;productboard-engineering&#x2F;countering-microservice-disasters-5a8f957803cb" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;productboard-engineering&#x2F;countering-micro...</a>
评论 #27498506 未加载
ferdowsialmost 4 years ago
It&#x27;s interesting to hear about stability concerns. Overall I think my organization moving to microservices improved our resiliency story. It allowed us to freeze sensitive legacy services and gradually build other surrounding services that incrementally replaced those legacy services with better-performing Go services. Rolling out new services is not onerous due to our Kubernetes platform (which was nowhere near as difficult to build on as some might suggest).<p>Strong service boundaries helped us, they didn&#x27;t hold us back.
mbrodersenalmost 4 years ago
If you are not a good enough developer to build monoliths then you are not a good enough developer to build micro-services.
gravypodalmost 4 years ago
&gt; One could not just look into a project in their IDE, but it required to have multiple projects open simultaneously to make sense of all that mess<p>Why not both? You can set things up so your go-to-def can understand your API calls and head to the right place. This is very easy to do with a monorepo + protobuf setup.<p>&gt; How much does it cost to spin 200 services in a cloud provider? Can you do it? Can you also spin up the infrastructure needed to run them?<p>Assuming 256mb RAM&#x2F;service you&#x27;re still well within 1 machine territory. Once you get above 1 machine territory you can set things up so that you can:<p>1. Build really good integration testing tooling so that devs don&#x27;t really need to interface with all services. In a test spin up everything you need + deps, run an API call, tear everything down. This can be cached if your build system does that. You can run into issues if you have situations where 1 API call hits <i>every</i> service but if you&#x27;ve done that you&#x27;ve already messed up. In those cases the best you can do is mock a step in the chain there, run a few test hits the entire chain before release, but then have devs run against the mock in their integration tests.<p>2. Hybrid environments. You run a dev cluster that has all of your basic infrastructure that doesn&#x27;t change much and provide a way for developers to launch new tasks that don&#x27;t get routed to unless the driver has a feature flag flipped. Essentially you have a &quot;dev&quot; cluster that is continuously delivered from your master repo, each developer has the ability to launch new tasks in this cluster, and they can say &quot;all traffic from alice for FoobarService should go to `{namespace=bob,service=Foobar}`.<p>&gt; As you can imagine, end-to-end tests have similar problems to development environments. Before, it was relatively easy to create a new development environment using virtual machines or containers. It was also fairly simple to create a test suite using Selenium to go through business flows and assert they were working before deploying a new version.<p>Why is it not simple anymore? I&#x27;ve implemented this at more than one company.<p>&gt; Aside from being an obvious single-point-of-failure, defeating some of the service-oriented architecture&#x27;s principles, there&#x27;s more. Do you create a user per service? Do you have fine-grained permissions so service A can only read or write from specific tables? What if someone removes an index unintentionally? How do we know how many services are using different tables? What about scaling?<p>Come up with a convention for your company and stick to it. If you can automate it that&#x27;s better. If you build some way for your task you are running to know &quot;who&quot; it is they can inject that information into other libraries. For example you can inject the following environment variables into a container:<p><pre><code> FOOBAR_DB_ABCD=pg FOOBAR_DB_ABCD_PASSWORD=... FOOBAR_DB_ABCD_HOST=... FOOBAR_DB_ABCD_PORT=... </code></pre> You can then have some library you write expose a `OpenDatabase(&quot;abcd&quot;)` that connects in and injects everything. A security operator can then provision accounts and everything transparently. If you generate those env vars from some automated config management tool you don&#x27;t even have to see the passwords.<p>&gt; Instead of having a monolith getting all of the traffic, now you have a home-made Spring Boot service getting all of it! What could go wrong? Engineers quickly realize this is a mistake, but as there are many customizations, sometimes they cannot substitute this piece for stateless, scale-friendly ones.<p>I don&#x27;t think this is a single point of failure. This is a single point of failure for a specific <i>subset</i> of your infrastructure and at that it should be a very simple (mostly-pass-through) component. If your mobile gateway dies, your backend one shouldn&#x27;t. If all of your API gateways die then your integrations to third parties that are required for legal compliance should stay up, etc.<p>&gt; I&#x27;ve seen teams using circuit breakers and then increase the timeouts of an HTTP call to a service downstream.<p>You should always decrease timeouts for operations if you&#x27;re attempting to retry calls. You can also use a load balancer that already knows the liveness state of all of your instances.<p>Aside from this bit I mostly agree with this section about timeouts, retries, etcs is actually correct. If you are tackling a single problem that&#x27;s simple don&#x27;t break it into a distributed system. If you are saying &quot;I want to have X but we should implement a Y&quot; where Y is a completely different thing that doesn&#x27;t need to talk to X directly, then why not implement it in a separate binary? There&#x27;s no reason they can&#x27;t share code to make the burden of operation low.
jameshartalmost 4 years ago
I guess you just won’t get traction on HN writing ‘Disasters I’ve seen in a monolithic world’.<p>If you have never gone through a significant dependency upgrade on a large monolithic codebase, you might not appreciate the value of microservice architecture. I’ve been at companies where the number one technical achievement for a tech organization for an entire calendar year was ‘successfully moved the app from .net 2 to .net 4’. Have you ever gone through the process of integrating an acquired company’s monolith into an acquiring company’s monolith? It’s futile. With a microservice architecture though I’ve seen acquisitions integrate significant systems (things like billing and auth) in a matter of weeks where monolith projects dragged on for years.<p>Sure, there’s no silver bullets. But there are a <i>lot</i> of problems with monoliths which microservices eliminate. Not without trade offs, naturally.
评论 #27496059 未加载
评论 #27496304 未加载
评论 #27498030 未加载
ryanthedevalmost 4 years ago
I work in a 300+ project monolith. If you think microserivces are an issue. I can’t help you.<p>I have worked in both. Until you realize that both worlds have their pros and cons, just stop.
fraysalmost 4 years ago
Great read, thanks.