Live data from Hacker News

Build the Modular Monolith First

fearofoblivion.com

11–20 of 90 posts

Re: Build the Modular Monolith First

#11
post #3

The assertion that monoliths are taboo is a bit odd; “monolith first” has been pragmatic best practice for years: https://martinfowler.com/bliki/MonolithFirst.html .

I think this depends on who you listen to, but I'm a huge fan of the monolith and wouldn't break one up unless I has a specific tech need(eg some weird library), a performance issue unaddressable in the monolith, or big organizational people problem and in that order.

Re: Build the Modular Monolith First

#12
This is written like it's a novel take bucking the trend, but I feel like most things I have seen on this topic for at least several years now have the same observations and conclusions?

If anyone wants to actually speak up for microservices, I feel like that's what needs a defense at this point!

Re: Build the Modular Monolith First

#13
Completely agree! We build our .NET projects in a similar way too.

My current SaaS company has 8 web projects and 1 core project. Some of the web projects are SPAs using BFF and others are APIs for customers or our mobile app. They aren't tiny sites. We're up to ~500 controllers. All in a single repo and automatically deployed as a monolith. We have a super small but very productive team which we attribute to this simple design.

Re: Build the Modular Monolith First

#14
post #7

Earlier quoted context omitted.

That's what we're currently working on. Only 20% of the work now goes into actually improving the product.

That may be better than 100% of the work going into improving the product, taking 1/5 the speed it should.

We're still doing 100% of the work but with 20% of the quality.

Re: Build the Modular Monolith First

#15
There are more than two architectures.

I agree if you don’t have organizational scale, microservices solve problems you don’t have.

But there are at least three separate things that are ‘monolithic’ about a classical monolith. 1) the codebase, 2) the database, and 3) the build and release process.

And you can certainly modularize your codebase into libraries or independent modules, but retain monolithic builds and releases against a monolithic relational database - a ‘modular monolith’.

But I’m not sure that’s the interesting part to break up, especially if you are not trying to solve the organizational problems microservices help with.

On the other hand, modularizing your build and deployment process could be helpful even if you are a solo developer - because it helps you reduce cycle times, and make smaller changes which means that you can trace bugs more quickly.

And modularizing data access is better for security and reducing blast radius of bugs or errors.

Modularizing the codebase seems much more like a problem you only need to tackle when your organizational complexity increases.

Re: Build the Modular Monolith First

#16

This is written like it's a novel take bucking the trend, but I feel like most things I have seen on this topic for at least several years now have the same observations and conclusions? If anyone wants to actually speak up for microservices, I feel like that's what needs a defense at this point!

Microservices to me are solving two problems: an organizational problem and a technical problem. The organizational problem is more obvious: well-factored monolithic codebases go poorly with large, interdependent groups of teams. The technical problem is that while it’s true that you can write a monolith in a modular style, in my experience enforcing the single responsibility principle in a monolith demands a level of discipline that is not feasible to maintain indefinitely in an environment with personnel turnover. When architectural coupling requires making coordinated changes to multiple services, the barrier is high enough that people will tend to avoid it instead.

Re: Build the Modular Monolith First

#17
Any team starting with microservices on an unvalidated concept likely hasn't built a big project from the ground up before

If it's a small engineering team there is nothing more optimal than working on a big scappy vertical codebase in the early stages

In the fortunate situation you need to start scaling -- breaking that out into MS later is usually low effort and fun

If you break it up to early you often end up with logic ghettos forming in the wrong stack that become near impossible to relocate later

I was talking to a startup last year who were hiring several hundred engineers to build a handful of microservice stacks in anticipation of the traffic they may get at launch (success expected because of previous unrelated founder experience), and wanting to make it easier to deploy vast engineering resource on it -- they've still not launched anything

Re: Build the Modular Monolith First

#18
post #13

Completely agree! We build our .NET projects in a similar way too. My current SaaS company has 8 web projects and 1 core project. Some of the web projects are SPAs using BFF and others are APIs for customers or our mobile app. They aren't tiny sites. We're up to ~500 controllers. All in a single repo and automatically deployed as a monolith. We have a super small but very productive team which we attribute to this si…

BFF ?

Re: Build the Modular Monolith First

#19

There are more than two architectures. I agree if you don’t have organizational scale, microservices solve problems you don’t have. But there are at least three separate things that are ‘monolithic’ about a classical monolith. 1) the codebase, 2) the database, and 3) the build and release process. And you can certainly modularize your codebase into libraries or independent modules, but retain monolithic builds and re…

Similarly, I feel like microservices are implemented to help with "scale", but it's often fuzzy which metric is being scaled. You can scale

1. Number of developers in your org 2. Number of users on your platform 3 Amount of data or compute used

Not all products need to scale all of these dimensions, and a microservice architecture may or may not help much. I'd argue that you probably get better results for #2 by optimizing database queries and implementing a good catching layer

Re: Build the Modular Monolith First

#20
post #13

Completely agree! We build our .NET projects in a similar way too. My current SaaS company has 8 web projects and 1 core project. Some of the web projects are SPAs using BFF and others are APIs for customers or our mobile app. They aren't tiny sites. We're up to ~500 controllers. All in a single repo and automatically deployed as a monolith. We have a super small but very productive team which we attribute to this si…

BFF ?

Backend for frontend
Post reply on HN