Live data from Hacker News

Monolith First (2015)

martinfowler.com

71–80 of 82 posts

Re: Monolith First (2015)

#71

Earlier quoted context omitted.

Scaling a monolith is almost always cheaper than migrating to microservices and scaling that. When you split it into microservices you are adding a bunch of infrastructure that did not need to exist. Your app performance will likely go way down since things that used to be function calls are now slow network API calls. Add to that container orchestration and all sorts of CNCF-approved things and the whole thing ballo…

> Scaling a monolith is almost always cheaper than migrating to microservices and scaling that. No - it depends on capacity needs and current architecture. > When you split it into microservices you are adding a bunch of infrastructure that did not need to exist. Unless you need to scale in an economical manner. > Your app performance will likely go way down since things that used to be function calls are now slow ne…

    > Scaling a monolith is almost always cheaper 
    than migrating to microservices and scaling that.

    No - it depends on capacity needs and current 
    architecture.
It does depend, but a monolith of any nontrivial size is going to require hundreds if not many thousands of hours of engineer time. That's a lot of money right there. IME often the experience comes down to something like $250K of engineer time vs. maybe $2K/month of server capacity.

Again, though: it does depend.

Re: Monolith First (2015)

#72
I think the overall thesis here is accurate. I can fill in the blanks where Fowler is light on anecdotal evidence. I have done many architecture reviews and private equity due diligence reviews of startup systems.

Nearly all the micro services based designs were terrible. A common theme was a one or two scrum team dev cohort building out dozens of Micro services and matching databases. Nearly all of them had horrible performance, throughout and latency.

The monolith based systems were as a rule an order of magnitude better.

Especially where teams have found you don’t have to deploy a monolith just one way. You can pick and choose what endpoints to expose in various processes, all based on the same monolithic code base.

Someday the Internet will figure out Microservices were always a niche architecture and should generally be avoided until you prove you need it. Most of the time all you’re doing is forcing app developers to do poorly what databases and other infrastructure are optimized to do well.

Re: Monolith First (2015)

#73

Earlier quoted context omitted.

> Scaling a monolith is almost always cheaper than migrating to microservices and scaling that. No - it depends on capacity needs and current architecture. > When you split it into microservices you are adding a bunch of infrastructure that did not need to exist. Unless you need to scale in an economical manner. > Your app performance will likely go way down since things that used to be function calls are now slow ne…

> Scaling a monolith is almost always cheaper than migrating to microservices and scaling that. No - it depends on capacity needs and current architecture. It does depend, but a monolith of any nontrivial size is going to require hundreds if not many thousands of hours of engineer time. That's a lot of money right there. IME often the experience comes down to something like $250K of engineer time vs. maybe $2K/month…

JohnBooty, you sound like someone I'd enjoy working with. Sounds like you have your head screwed on correctly.

Re: Monolith First (2015)

#74

I firmly believe that monolith vs microservice is much more a company organization problem than a tech problem. Organize your code boundaries similar to your team boundaries, so that individuals and teams can move fast in appropriate isolation from each other, but with understandable, agreeable contracts/boundaries where they need to interact. Monoliths are simpler to understand, easier to run, and harder to break -…

Microservices are indeed the best approach if you want to ship your org chart. That's all there is to it. Most of the technical justifications do not make sense, outside of very niche org requirements which aren't really all that common. Take, for example, the idea that you can scale individual services independently. Sounds amazing on paper. However, you can also deploy multiple copies of your monolith and scale the…

I agree with you.

It seems people think "Big Ball of Mud" when they hear Monolith but they're not equivalent. Jut like I tend to hear "Spaghetti Code" when I hear Microservices. But again they're not equivalents. Both architectures are equally capable of being messy.

Re: Monolith First (2015)

#75
post #41

Earlier quoted context omitted.

Yep. Conway's law [1]: Organizations which design systems (in the broad sense used here) are constrained to produce designs which are copies of the communication structures of these organizations. — Melvin E. Conway, How Do Committees Invent? [1] https://en.wikipedia.org/wiki/Conway%27s_law

You can run it backwards! Get a high level software design, then make the org-chart.

There's a book by Lex Sisney about that called Organizational Physics. Interesting read.

Re: Monolith First (2015)

#76
post #53

I think microservices can be useful for nontechnical reasons: They let you take the "org chart becomes architecture" from an unseen, not really understood force into something explicit that you can observe and manage. Instead of multiple teams working on the same codebase and stepping on each other's toes, each team can have clear ownership of "their" services. It also forces the teams to think about API boundaries a…

>org chart becomes architecture

Tbh, it didn't work for us: our org chart changes more frequently than the codebase's architecture (people come and go, so teams are combined, split, etc. to account for that, many devs also like rotation, because it's boring to work on the same microservices forever), so in the end basically everyone owns everything. Especially when to implement a feature, you have to touch 10 microservices -- it's easier and faster to do everything yourself, than to coordinate 10 teams.

>Second, with monoliths, there is some temptation to violate API boundaries if it let's you get the job done quickly, at the expense of causing headaches later: Just reuse a private until method from another module

This is solvable with a simple linter: it fails at build time if you try to use a private method from another module. We use one at work, and it's great.

Re: Monolith First (2015)

#77

Yes. It does require thinking about the monolith in a way so it can be broken up should the need arise. Going down the monolith path != Having spaghetti as the core abstraction. :)

There's the ideal path, then the actual. Most monoliths, unchecked and with enough age, turn into spaghetti due to turn over, changing priorities, entropy, etc.

The majority of microservice architectures end up being distributed monoliths.

Re: Monolith First (2015)

#78
post #49

Earlier quoted context omitted.

In my opinion it is too literal understanding of the concept and there is no universal borderline in size or scope. It is common in practice to find quite fat microservices because their maintaners decided it doesn't worth to have yet another network communication latency for a specific case. The main problem here is to be able to effectively debug and maintain several communicating services: to have a distributed tr…

> there is no universal borderline in size or scope There doesn't need to be. It's applied in specific contexts where the distinction is clear for that context. You said "A monolith is just one microservice." But it's not, because they're literally defined as opposites. You might as well say "the color white is just one shade of black." It's not adding anything helpful -- it's quibbling over words.

> It's not adding anything helpful -- it's quibbling over words.

That depends on the context. If I come to the paint store I would be surprised if I'm offered either black OR white paint. As If I can not buy and use both, depending on my scenario. Black and white are generally not the same thing, but they are not mutually exclusive in your practice.

(and by the way comparing sizes to color is a bad analogy. the better one would be comparing a big ship with a set of ships. So I state that I can have a fleet of ships, some of which are also big. And one big ship is also can be considered a temporily outnumbered fleet: if it has means to cooperate I can easily add more smaller ships when needed, instead of builidng yet another deck on the main ship).

My point is: microservices vs monolith is a false dichotomy. You can use both approaches at the same time, since each one of them has its own advantages.

If your infrastructure is ready and you know how to manage microservices, than you can just start building monolith unless you decide that some particular part is better be separated due to some reasons like context isolation, separate deployment, separate scaling etc. It will take you a day for the first time. And an hour for the second time and further.

However if your "infrastructure" is just local files with logrotate on a bare-metal machine, if you don't know how to reuse the common code base for different deployment units or if you do not know how to do backward compatible protocol schema evolution, then bad luck -- you just do not have a choice when it comes to designing a new functionality. You'll have to add the new feature to your monolith despite all the benefits you could reap by separating it.

Microservice-ready infrastructure is all about having the capability to separate parts of logic easily when you want to. It neither dictates you to break your monolith right away nor to build only 30 lines of code services from now on

Re: Monolith First (2015)

#80
post #73

Earlier quoted context omitted.

> Scaling a monolith is almost always cheaper than migrating to microservices and scaling that. No - it depends on capacity needs and current architecture. It does depend, but a monolith of any nontrivial size is going to require hundreds if not many thousands of hours of engineer time. That's a lot of money right there. IME often the experience comes down to something like $250K of engineer time vs. maybe $2K/month…

JohnBooty, you sound like someone I'd enjoy working with. Sounds like you have your head screwed on correctly.

A high compliment!
Post reply on HN