❔ What architecture is recommended for a new (to be enterprise) project?
I've decided to opt for a monolith. What I see most commonly around here is vertical slice, clean and n-tier with regards to specific architectures.
Which one do you recommend me if I were to build a site similar to booking.com?
The reason I'm asking is, at first I thought clean was a no-brainer, but it seems to be highly opinionated and many claim it over-complicates things and that the popular templates out there (ardalis and taylor(?)) are riddled with redundant abstractions.
12 Replies
yes, clean architecture is horizontal slicing and concern separation, so like database access is a separate project from usage, and all the models go into the models folder, all the controllers go into the controllers folder, etc, which makes finding code responsible for the same feature difficult. but separating everything into clearly defined layers is its whole idea.
you can also separate by feature, or vertical architecture
it's good if there are many features to the app I guess
aren't n-tier / three layer and clean very similar? i always see core, web and infrastructure. sometimes domain too but its often baked into core (bll). What is the difference?
domain == infrastructure
i would go for feature isolation but only if you are sure it will develop and it's not a sample, and if you got time to do it
The main point of hexagonal architecture with ports and adapters (what Ardalis package does) is that domain is not infrastructure and it's totally separated
https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749
Medium
Ready for changes with Hexagonal Architecture
A story on how we leveraged Hexagonal Architecture principles to be prepared for changes in the Netflix Studio ecosystem.
When your project scales beyond yourself and you have other people working with you then these abstractions you mentioned are not redundant. They improve code maintenance, testability, consistency etc.
@David_F I see. What about repo pattern over ef? Redundancy?
if (this.finalVersion == true) { }
i'll look into it
Look at vertical slices
Clean Architecture with DDD/CQRS principles.
My worry weth vertical slice is, as the project grows and has a lot of business logic, won't it turn into a big mess?
If the project grows, you may want to think about splitting logic into another service or having some sort of common lib that takes in common functionality.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.