Question

I'm wondering how service oriented architectures can follow the 12-factor principles.

Designing an architecture as microservices means (to me) that you separate the features in services. This means you have multiple code source for the different services.

The first principle of a 12 factor application is "One codebase". So if we have multiple services, we have several codebases and the first principle is broken.

Are the two architectures mutually exclusive or did I misunderstand something?

Was it helpful?

Solution

Did you click through to the full description of the first factor?

If there are multiple codebases, it’s not an app – it’s a distributed system. Each component in a distributed system is an app, and each can individually comply with twelve-factor.

So when thinking about 12-factor apps in the context of microservices, treat each microservice as a separate app.

OTHER TIPS

Microservices need not be in separate codebases. There shouldn't be shared dependencies, and that's certainly harder to maintain in a single codebase, but it's not prohibitive. Having your various microservices in a single codebase has some advantages like easier code searching, nicer commit atomicity, easier code backups, easier authentication/authorization, easier testing and static analysis... It's generally how I've seen them setup.

Licensed under: CC-BY-SA with attribution
scroll top