Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
You can setup metric for that or see the data.Inside a monolith it's easy to answer questions like "Which dependencies are we shipping?"; or "Is this piece of code still used?” Once the code is spread across dozens of independent services, those answers become much harder to obtain.by fsuts- I wrote a post on my blog[1] a while back about this. Actually, there are records in memoirs and such that show similar pressures existed when MSA emerged.
[1]https://www.makonea.com/en-US/blog/how-did-microservices-arc...
by jdw64 - This is what people always say but it's not really the only case, and it's not even a particularly good case. You could achieve the same organizational thing through modules, for example.
The real—and the one thing you can't replicate—is data isolation.
Of course there are other benefits, but it's data isolation is the differentiator of micro-services and other types of architecture.
by asimpletune - It's not just the modular organisation that you've got to get right though, although that's definitely a big thing. Deployment independence matters too: if I've got a perfectly modular monolith but I have to coordinate with everyone else who lives in that monolith to get my module into production, it's leaving half the gains on the table.by regularfry
- I’ve been building a lot on cloudflare workers recently and I feel like microservice works pretty well there.
Sometimes you want to have some shared infra abstracted behind a single interface and a single auth model.
Having a service gives you that single isolated unit/abstraction.
In practice it’s always a scale. Some services will be bigger and some will naturally be split out.
I think also having the right server platform that makes it trivial to deploy/standup infra quickly makes this much easier.
by aleksiy123 - Compare the fuel pump of a Jumbojet and of a car. Is the smaller one a micro-pump? No, they are both pumps. Any "micro service" is just a service. Ref: Juval Löwyby arnejenssen
- A "real" microservice (according to some definitions) might be only really necessary for organizational reasons. But the services in a distributed monolith are also often called microservices (at least in my company). And for them I believe there is another good reason that I do not hear about in these discussions: robustness.
In our software project, we have had many issues with OOM and golang panics in a goroutine killing our critical endpoint even though the fault was most times caused in the administrational endpoints. By separating the critical endpoint from our administrational ones in two separate services, we reduced the criticality of those issues and therefore also the number of hotfixes we needed.
by linbaato - > But the services in a distributed monolith are also often called microservices (at least in my company).
I thought that was a "microlith".
- I decided to take a career break and build an open source project to manage services better. Feedbacks are welcome, product is too early for adoption.
https://github.com/GoPlasmatic/Orion
Design principles: * Isolate business logic from service framework using declarative coding * Make the logic representation machine-writable so AI is a first-class author * Treat business logic as versioned data, not compiled services * Ship governance with the platform, not with each service * Invoke services in-process, not over the network * Modular monolith — export and scale a service independently when needed * Push integrations into declarative connectors, keep logic pure
by codetiger - Something people use to architect towards being the next Amazon, before they've even got their first 100 users. Also useful for CV padding.
Genuinely useful method for abstraction, concern/dependency separation, scaling, and so forth, for teams & projects that genuinely need what they offer.
by dspillett - Or build core infrastructure right the first time, and not spend millions of dollars turd-polishing while your competition eats the market.
Davids talk makes some good arguments, but does not fully acknowledge low-maintenance infrastructure at scale. =3
"10 tips for failing at microservices" (David Schmitz)
by Joel_Mckay - I feel like the discussion between "monolith" and "microservices" is a false dichotomy.
For a big software company, you don't have to ship a single behemoth monolith, but you don't have have microservices so small that a team of 3 has to manage 10 services.
You can have "right size" services. I don't like to call them micro because they can be fairly big and do multiple things, as long as it makes sense to have them in a single service.
by eloisant - We had services mostly built around deployment requirements. This package runs on the CDN edge, this other one runs centrally on a cluster.by inigyou
- > Inside a monolith it's easy to answer questions like "Which dependencies are we shipping?"; or "Is this piece of code still used?" Static analysis can often tell you. Once the code is spread across dozens of independent services, those answers become much harder to obtain.
I draw the opposite conclusion here. In monoliths, someone else might want the code to stay in the codebase. I don't want to ask everyone about it. Everyone's responsibility is no-one's responsibility, and the code stays as is.
In a microservice, I publish an interface, and I'm free to tear up all the carpet behind it as long as it keeps doing its job as advertised. Knowing whether public routes are still in use is still a problem, so you need a minimum level of metrics or logging before you can retire an endpoint.
by mrkeen - This is complete lack of experience on the authors part. No tracing, no observability, no knowledge of distributed systems design to allow them to see what they can clearly measure. Your take is the correct one. Microservices break up the monolith so that multiple teams can work on pieces of the solution/platform without stepping on each others toes. The rest of it is documentation/discovery.by reactordev
- You do exactly the same in a monolith, functionality is broken into modules with a public API and you can switch out the implementation at any time if you want or have to.by danbruc
- > I draw the opposite conclusion here. In monoliths, someone else might want the code to stay in the codebase. I don't want to ask everyone about it. Everyone's responsibility is no-one's responsibility, and the code stays as is.
Then they can retrieve it from source control? Leaving dead code in the codebase because "someone else might want it" sounds like nonsense.
- Microservices still have global concerns. Is someone actually using that endpoint or can you remove it? How will you know? Ask everyone?
How many HTTP calls are made during one user request and how long does it take? (This concern brought down one of the early microservice projects with a 10-minute page load time)
What are the race conditions? User removes billing info at the same moment as making a payment - what happens? Is the payment marked as successful but not actually billed?
by inigyou - I think you described not monolith vs microservices, but single person working on a project and making decisions vs multiple. “Everyone’s responsibility is no-one’s responsibility” works the same way if multiple people work on the same microservice.
Also a monolith may (actually, must) have internal public interfaces through which components must communicate, and those contracts are more enforceable, amenable to static checks, and much higher performance that microservices’ network interfaces.
by nlitened - It's called programming to an interface.
type ThingDoer interface { DoTheThingIDontCareHow() (result, error) }
func NewAmazingThingIMade(theThingINeedButIDontCareHowItDoesIt ThingDoer) { // You receive the superduper thing and dont care about it in any other way }
func (a *Amazing) DoSomeThing() (result, error) { return a.DoTheThingIDontCareHow() }
Nothing about "monoliths" prevents or hampers this development style. Once someone decides to do the Thing in another fashion, they are free to do so and you wouldn't have to change a thing.
All problems you experience are organizational, not technical. It's psychology we should be studying, not computer science.
Edit: In fact you introduced a network boundary which can fundamentally only complicate matters, not make them simpler.
by sdfdfsfsdsdf - In my experience, almost all the problems that microservices advertise solving can also be solved with a modular monolith plus some tooling to enforce certain rules (say, one module shouldn't be able to peek into another module's internals, bypassing an agreed-upon "clean" public interface; that alone solves most spaghetti-code problems)
There are two things monoliths can't easily offer:
* Using different frameworks, languages, etc. But in my experience, it's pretty rare for a team to use many programming languages at once. Usually, it's just a few highly performance-sensitive services that need to be written in another language (say, a proxy in Rust while the rest is in Python). For that, I prefer an architecture with one main monolith plus a few high-performance satellite services. No problem there.
* More optimized scaling in certain scenarios. Say I have a module that processes files and can use all available CPU. I might want to put it in a separate container on another node so that the processing doesn't destabilize the core web server. Technically, monoliths support this too, just run the monolith in a different mode (say, behind an `--image-process` flag of sorts), and you can schedule it on another node in the same way. The only downside is that it may use more RAM than necessary for the extra binaries or scripts that won't be used
What else am I missing?
by kgeist - > But in my experience, it's pretty rare for a team to use many programming languages at once
Teams sure, but your whole org? Nothing wrong with all teams using same tools and language, nothing wrong with them choosing their poison. Of course your monolith can have multiple build systems.
But I think this is beside the main point of the article anyway, and it’s the part about how microservices help create boundaries that mirror organizational boundaries.
by yes_man - Concerns that shape my own decision to run Marginalia Search as a service based architecture rather than one blob include:
* NUMA optimization - on multi-CPU architectures, I/O and/or memory bottlenecked software takes a pretty significant performance hit if you let is run on both CPUs, and this has knock on effects that also degrade the performance of other software running on the same machine.
* Network namespaces - if you're e.g. running an internet crawler, and want to assign one host machine multiple public IP addresses, this is much easier if you use something like ipvlan.
* Stateful long running process lifecycles (e.g. crawling) that coexist with the need for live redeployments of other parts of the system.
- Data isolation, separate auth/permissions/roles, Compliance, crash isolation, Resource/capacity management
There’s probably more off the top of my head. Not that I necessarily advocate for the micro in services. Just the sliding scale of macro-micro services.
These are more problems in larger companies.
by aleksiy123 - This is basically Conway's Law in practice: microservices aren't created because of technical boundaries, but they emerge because organizations need team boundaries.by turnersauce
- That's the sane way of using services, but micro-services used in the wild are often used without any organizational consideration at all: as a consultant I witnessed countless of small companies and start-ups who had multiple times more services than developers! (The biggest culprit was the latest one: 61 micro services for 3 devs and a PM, and it wasn't even an outlier) .
What could be a sensible architecture for large orgs has become more of a cult-like behavior that drags everyone down.
by stymaar - Some of it is Conway's Law, much though seems purely "cargo cult engineering" or "FAANG cosplay".
Less-competent devs and CTOs hear that Amazon & Google use it, then decide their 12-person team needs to rewrite their product as 5 separate services. I have encountered companies with 50 services where they needed 5, spending 60% of their dev velocity on overhead.
If you're contemplating microservices & haven't already nailed your business transaction boundaries, reliability mechanisms, idempotence, deployment management/ versioning, observability, testability and the operational discipline to run distributed systems you should just stop -- you have no freaking clue and you're going the wrong way.
by twhitmore - Human boundaries are technical boundaries. If you're building for humans, then human limitations are part of the technical requirements.
e.g., there's a reason that fancy buildings have maintenance hatches for humans
by Ferret7446 - Microservices exist because of the limitations of a single human brain in being able to wrangle with that much logic at a time.
It is perfectly conceivable that an alien species with different brain characteristics would draw their microservice boundaries at very different points, possibly varying by a whole order of magnitude in either direction.
I don't agree that there are organizational causes even though that's oft repeated as one of the main reasons. I have never seen a one-to-one relationship of microservices and teams irl. Most teams own many services and some services get touched by many teams. In big companies, there are also microservices with zero owners.
by roncesvalles - They can serve multiple purpose and that's not the problem, because there's precedent in the literature -- software architecture the hard parts https://www.oreilly.com/library/view/software-architecture-t... -- for teams to organize architecture review cycles and decide if some microservers are better merged into a monolith. This however requires tons of refactor when microservices aren't design with this part of its lifecycle in mind, and we all know how this kind of investment is risky and hard to communicate to non-technical management.by gchamonlive