Continuous Integration (CI)
After developers submit code, the code is built and tested (automated unit testing or integration testing) immediately, giving quick quality feedback on the submitted code and ensuring that the integrated code does not break the functionality of the original code. Continuous integration allows submitted code to receive quick feedback. The code can only be successfully integrated into the integration branch after passing the tests, thus reducing problems that may occur after integration. For modern distributed application development tasks, continuous integration means continuously building and verifying all components of rapidly evolving distributed applications through automated means, providing effective feedback and confidence to the team. Automated means mean low cost and repeatability. Effective feedback means faster problem localization and higher software delivery quality. Software development teams that effectively practice continuous integration have higher software development efficiency. Based on the above definition, effective continuous integration should have the following characteristics:
Rapid feedback loop: The cost of locating changes with problems increases as the changes move to later stages. Each integration is a feedback loop for the team. All feedback is translated into effective actions by the team, enabling problems to be discovered and fixed as early as possible.
Automation: Each code submission should trigger automatic build and testing, which informs all team members through red and green colors.
The most common automatic triggering method is to use automated CI services or tools to automatically listen for events such as Git push and merge requests in the code repository. Common tools include Jenkins, Gitlab CI, CircleCI, Github Actions, etc.
Continuous Delivery
Continuous delivery is the next step after continuous integration, continuously and frequently delivering new versions of software to quasi-production environments (such as testing and pre-release environments) for testing and acceptance by test and business teams. Continuous delivery emphasizes "delivery." No matter how updates are made, the software can be delivered anytime and anywhere. Compared with continuous integration, in addition to delivering to quasi-production environments, continuous delivery also performs integration testing, API testing, etc. to ensure that the delivered products can be directly deployed.
Continuous Deployment
Continuous deployment is the next step after continuous delivery. It "automatically" deploys code to production environments. Continuous deployment emphasizes "deployment." Its goal is to ensure that code is deployable at any time and can enter the production stage. The difference between continuous deployment and continuous delivery in terms of trigger methods is that continuous deployment is automatically performed, while continuous delivery is manually performed.
CI/CD Pipeline
Alibaba Cloud Codeup is an enterprise-level automated continuous integration and continuous delivery tool. It completes the entire CI/CD process from development to deployment through automated build, integration, verification, and deployment, helping enterprises deliver business with high quality and high efficiency.
Deployment Strategy
In the real deployment process, if the full release is used, it will bring unknown risks to the Dev and Ops teams. In the application deployment process, it is recommended to use the gradual release and phased release modes to minimize the impact of unstable releases on users and ensure stable business delivery.
Observable Release Process
For production systems, once there is a code change online, the observability of the business needs to be considered. Observability mainly includes the following three aspects:
Metric monitoring: Various metric monitoring, such as basic resource metrics (such as CPU and memory usage of hosts), service performance metrics (such as increased response time), and business call metrics (such as increased failure rate of user login and order placement). Metrics also need to be further categorized. For details, please refer to the observability section.
Logs: Pay attention to the operation logs of various devices and services, especially checking for exceptions or error logs.
Tracing: Pay attention to the current application's upstream and downstream call chain analysis for the release.
Deployment Rollback
Once the code is deployed to production, if there are any impacts on the service or business, the priority is to perform a rollback to ensure smooth operations. It is necessary to consider whether the service rollback is seamless and if there are any issues with data integrity, such as dirty writes. When choosing related CI/CD tools, it is also important to consider the ability to support fast rollback.