Can anyone recommend good examples of monoliths in open source? Preferably in Go?
I inherited a bunch of micro services at my current job with a fairly small team. My feelings have been that the code had been prematurely micro-serviced considering the team is so small and every service was mainly just CRUD in front of then same Postgres instance.
I’ve slowly been demonstrating the benefit of modularlized “sub-apps” in a single monolith over lots of microservices that all reinvent the wheel. And I think I’ve convinced them that this is easier going forward. But I’m at a loss sometimes about what boundaries I should be putting in place such that we don’t end up with a ball of mud in two years.
Not in Go, but Discourse is a monolithic rails app on Github which I've used as an example for my own employment's code base in the past. Another example is Gitlab's code base (also Rails).
I think what he meant is that Rails as a Framework doesn't push you to implement modularity internally. The convention chosen to organize your files pretty much guarantee a monolith.
People confuse monolith and monorepo all the time. If you have a monolith where each independent module communicate via queue, like described in the article, you are so close to having a monorepo of horizontally scalable micro-services.
Kubernetes always gets brought up but I would argue that while it is large it is not simple and was not architected to be understood by novices to monolith projects. The goal of kubernetes is to be kubernetes, not to be a pristine learning example - and though you can learn from studying it it is probably not the best place to start learning.
I recommend you to have a look at Django and Rails for inspiration. People love to hate them, but they get the scalable monolith just right in my opinion.
Speaking about Django, the framework provide core features (HTTP handling, database connections, ORM, templating...) that apps (what you call "sub-apps") can leverage. A Django project is just a collection of apps, either yours or third-party.
> look at Django and Rails for inspiration. People love to hate them
You'll always get some portion of the community hating whatever's on top. Even in 2018, if your startup isn't using one of these two, you'd better have a damn good reason. Rails, and to a lesser extent Django, are the absolutely boring but productive as fuck workhorses of any startup. Bypass them at your peril when your project passes in front of competent due diligence.
If one wants to get technical, Linux is only the kernel, which is why Richard Stallman pushes people to refer to most of the complete operating systems that use it as GNU/Linux [1]. And Linus Torvalds and Andrew Tanenbaum had a very famous flame war [2] over the issue of monolithic kernels vs. microkernels, in which Linux was the monolith, and there are a lot of parallels between this article and the design considerations at stake. Not all of the advice here applies well to kernels, IMO. But one can certainly say that from a practical standpoint, Linus Torvalds has a few reasons to feel that he and his monolithic kernel won that particular debate.
I inherited a bunch of micro services at my current job with a fairly small team. My feelings have been that the code had been prematurely micro-serviced considering the team is so small and every service was mainly just CRUD in front of then same Postgres instance.
I’ve slowly been demonstrating the benefit of modularlized “sub-apps” in a single monolith over lots of microservices that all reinvent the wheel. And I think I’ve convinced them that this is easier going forward. But I’m at a loss sometimes about what boundaries I should be putting in place such that we don’t end up with a ball of mud in two years.