In our last post, we talked about the 12 Factor App methodology—a set of best practices for building modern, scalable web applications. Now, let’s dive into the first factor: Codebase.
The idea behind this factor is simple but powerful:
You should have a single codebase, tracked in version control, that gets deployed to multiple environments.
In other words, whether you’re deploying to development, staging, or production, it should all come from one source of truth—one Git repository.
This keeps things clean and consistent. You avoid the mess of managing multiple versions of your app for different environments or clients, and you make it easier for your team to collaborate, track changes, and debug issues.
It might be tempting to copy your codebase into separate repos for different customers or environments, but this quickly becomes hard to manage. Instead, keep one codebase and rely on environment-specific configuration, which we’ll cover in detail when we get to Factor 3.
Now, let’s look at how Alibaba Cloud can help you stick to this principle while still giving you the flexibility to manage multiple environments.
Even though Alibaba Cloud doesn’t host its own Git service, it integrates seamlessly with platforms like GitHub, GitLab, and Gitee. You can manage your codebase there, and then use Alibaba Cloud CodePipeline to handle builds and deployments.
Using CodePipeline, you can:
Everything stays consistent and automated.
If you're using Docker, Alibaba Cloud has you covered:
Here’s how a typical flow might look:
That image is deployed to:
The result? You’re deploying the same app across multiple environments—but without ever duplicating the codebase.
The first factor is all about centralizing your code, and letting your environments vary only by config. Alibaba Cloud makes it easy to do just that, thanks to its tight CI/CD integrations, container support, and secure configuration tools.
In our next post, we’ll look at Factor 2: Dependencies—and how you can declare and isolate your app’s dependencies properly using tools like ACR, Function Compute, and more. This helps prevent the classic “it works on my machine” issues and gives you reliable builds every time.
Stay tuned, and don’t forget to subscribe to get the full 12-part series as it rolls out.
Blog 2: Factor 2 – Dependencies: How to Declare and Isolate for Reliable Builds on Alibaba Cloud
quetuliokervin - December 7, 2023
Alex - January 22, 2020
kervs - August 11, 2025
Neel_Shah - August 8, 2025
Miles Brown - December 2, 2025
Alibaba Cloud Data Intelligence - November 28, 2024
Backup and Archive Solution
Alibaba Cloud provides products and services to help you properly plan and execute data backup, massive data archiving, and storage-level disaster recovery.
Learn More
Drive and Photo Service
A low-code, high-availability, and secure platform for enterprise file management and application
Learn More
Architecture and Structure Design
Customized infrastructure to ensure high availability, scalability and high-performance
Learn More
Sensitive Data Discovery and Protection
SDDP automatically discovers sensitive data in a large amount of user-authorized data, and detects, records, and analyzes sensitive data consumption activities.
Learn More