Search⌘ K
AI Features

Design of a Code Deployment System

Discover the detailed System Design of a robust code deployment system. Outline the high-level architecture, define necessary APIs and storage schemas, and examine the build and deployment phases. Confirm how the final design satisfies all functional and non-functional requirements.

The previous lesson covered the fundamentals of the code deployment system, including requirements, resources, and key components. Now, we examine the high-level design.

High-level design

The high-level design integrates the components identified previously to meet functional and non-functional requirements.

High-level design of the code deployment system
High-level design of the code deployment system

The workflow operates as follows:

  • Users submit code to the version control system (VCS)Tool for managing and tracking code changes across versions.

  • The VCS triggers the continuous integration (CIPlatform that automatically builds and tests code changes after each commit) service. The CI system integrates code changes from multiple developers into a shared repository.

  • The code is placed in the pub-sub system. The code build service retrieves it from the queue and converts it to a binary.

  • Generated artifacts (binaries) are stored in primary blob storage.

  • Deployment triggers the download and installation of artifacts on machines in each region.

The following API design details the system’s functional operations.

API design

Essential APIs for the code-building and deployment process include:

Code-build APIs

Key APIs for the code-build process:

  • Submit code: Submits code to a specified repository in the VCS.

submitCode(code, repository, branch, message)

submitCode() returns a commit hash that uniquely identifies the new commit within the repository. This hash references and later retrieves the commit. The API uses the following parameters:

Parameter

Description

code

The code submitted to the VCS.

repository

This shows a path to a repository where the code is being submitted.

branch

Within a VCS, a branch represents an independent instance of the primary code or repository, typically identified by a unique name. In our case, it shows the branch name where the code is submitted or edited.

message

An optional message during a commit.

  • Trigger build: Triggers the build and preparation of the codebase for deployment.

triggerBuild(project_id, branch, commit_hash, configuration)

The triggerBuild() initiates the build process asynchronously ...