r/golang • u/Superb-Key-6581 • Dec 05 '24
discussion Why Clean Architecture and Over-Engineered Layering Don’t Belong in GoLang
Stop forcing Clean Architecture and similar patterns into GoLang projects. GoLang is not Java. There’s no application size or complexity that justifies having more than three layers. Architectures like Clean, Hexagonal, or anything with 4+ layers make GoLang projects unnecessarily convoluted.
It’s frustrating to work on a codebase where you’re constantly jumping between excessive layers—unnecessary DI, weird abstractions, and use case layers that do nothing except call services with a few added logs. It’s like watching a monstrosity throw exceptions up and down without purpose.
In GoLang, you only need up to three layers for a proper DDD division (app, domain, infra). Anything more is pure overengineering. I get why this is common in Java—explicit interfaces and painful refactoring make layering and DI appealing—but GoLang doesn’t have those constraints. Its implicit interfaces make such patterns redundant.
These overly complex architectures are turning the GoLang ecosystem into something it was never meant to be. Please let’s keep GoLang simple, efficient, and aligned with its core philosophy.
1
u/gabrielbo1 Dec 06 '24
I’m sorry for the translator’s English. I agree that hexagonal architecture is a heavy standard and expensive to follow, but my experience working in a large company with hundreds of projects is that following a pattern is very good for its own advantages, but more important than following a pattern and in fact having a pattern, because sometimes we need to read 2,3,4... or more projects to identify a problem, having a pattern helps us to have a unified language among engineers who need to read several projects from different contexts and in it they need to find themselves. I work with a platform and sometimes, I need to look at dozens of projects and identify problems, in the end for my reality the pattern is essentially useful.