DEV Community

loading...

Building cloud native apps: Codebase

lukaszbudnik profile image Łukasz Budnik Updated on ・2 min read

Cloud native codebase

Codebase is a first factor mentioned in the twelve-factor app manifest: https://www.12factor.net/codebase.

Although the twelve-factor app was last updated in 2017 I would still put it as a first factor when building my cloud native app. Why? Because everything starts with the code.

I would only change one thing in the original description of codebase factor...

When I started my professional IT career I was working with CVS (Concurrent Versioning System), then I was working with Subversion, did one project in Mercurial, but fell in love with Git.

Git is the undisputed king of version control systems. Git makes the dev world go round - it is the foundation of GitOps. If you're starting a new project, it has to be simply Git. And that is what I would change in the description of the original codebase factor.

The twelve-factor app also touches on an important matter: every app should have its own codebase. If you're building your cloud native app based on microservices then every service should have its own code repository. Developers have a tendency to do shortcuts, if multiple apps are stored in a single codebase there is a risk of referencing other apps directly and thus breaking the clear design. Finally, having one codebase per app simplifies a lot of: code management, release management, or even such basic stuff like CI/CD pipelines (not having to support multiple dev languages, build tools, Dockerfiles, etc.).

Where to host your codebase? My preference is GitHub. It's where I host all my projects and with (not so) recent announcement of unlimited private repos, GitHub made life so much easier. BitBucket is another alternative. Or perhaps if you're going with AWS then you can consider AWS CodeCommit and leverage the power of the AWS platform (IAM and other AWS Code* services). Just please don't host Git server yourself (as Nissan and a lot of other companies did and it didn't go as planned).

Once you have chosen your revision control system, you're ready to start building your cloud native apps.

Discussion (0)

pic
Editor guide