What is the Difference Between Centralized and Distributed Version Control

The main difference between centralized and distributed version control is that, in centralized version control, the versions are saved in the remote repository, while in distributed version control, versions can be saved in the remote repository as well as in local repositories of the local machines.

One major activity performed during software development is Source Code Management (SCM). The requirements of the software always change, and it is necessary to modify the source code. In SCM, these states of the projects are saved as versions. Therefore, the developer can keep track of the previous versions. Version control systems allow source code management, and it is beneficial in enterprise-level software development. Furthermore, there are two types of version control systems as centralized and distributed version control systems.

Key Areas Covered

1. What is Centralized Version Control
     – Definition, Functionality
2. What is Distributed Version Control
     – Definition, Functionality
3. Difference Between Centralized and Distributed Version Control
     – Comparison of Key Differences

Key Terms

Centralized Version Control, Distributed Version Control, Version Control

Difference Between Centralized and Distributed Version Control - Comparison Summary

What is Centralized Version Control

In centralized version control, there is a set of local computers and a single server. The server operates as the central location. When a developer changes the source code in his local machine, those changes get saved in the central server. The working copy is available in the local machine, but the versions are saved in the server. In other words, the central location manages the versions.

A repository is a storage area that stores source codes. We call the repository of the central server the remote repository. If there is a failure in the central location (server), the developer cannot access the versions. Furthermore, the developer will not be able to access the repository in the central location due to network connectivity issues. These are some drawbacks of a centralized version control system.

What is Distributed Version Control

Distributed version control provides solutions to the limitations of centralized version control. There is a set of computers and a server. The server has a remote repository. At the same time, each computer has its own local repository. There is no issue of the failure of the server as each machine has a local repository.  The repository is distributed among multiple machines. Therefore, we call this a distributed version control system.

Difference Between Centralized and Distributed Version Control

Furthermore, in this setup, each developer gets his own repository. He can make a change in the local repository and share it with the other developers. Moreover, there is no interference from other repositories. Each repository track history, perform pushing and pulling changes to other repositories, and supports merging. Besides, if there is no network connectivity, the developer can create versions in his own local repository. He can push the changes to the remote repository when the internet connection is available.

Difference Between Centralized and Distributed Version Control

Definition

Centralized version control is the simplest form of version control in which the central repository of the server provides the latest code to the client machines. Distributed version control, on the other hand, is a form of version control where the complete codebase (including its full history) is mirrored on every developer’s computer. Thus, this is the main difference between centralized and distributed version control.

Local Repositories

In centralized version control, there are no local repositories; however, in distributed version control, there are local repositories. Hence, this is also an important difference between centralized and distributed version control.

Speed

Furthermore, distributed version control works faster than centralized version control.

Internet Connectivity

Moreover, centralized version controlling always require internet connectivity while developers in distributed version control can work with a local repository without an internet connection.

Main Focus

Also, one other difference between centralized and distributed version control is their focus. Centralized version control focuses on synchronizing, tracking, and backing up files, while distributed version control focuses on sharing changes.

Failures

In centralized version control, a failure in the central server terminates all the versions, while in distributed version control, a failure in the main server does not affect the development. Thus, this is another important difference between centralized and distributed version control

Conclusion

The main difference between centralized and distributed version control is that, in centralized version control, the versions are saved in the remote repository while, in distributed version control, versions can be saved in the remote repository as well as in local repositories of the local machines. In brief, central version control is simple, but it has disadvantages. On the other hand, distributed version control is more flexible. Therefore, distributed version control systems such as Git are more popular in software development.

Reference:

1. “Intro to Distributed Version Control (Illustrated).” BetterExplained, Available here.
2. “#0 Git Tutorial | What is Git? | Github”. YouTube, YouTube, 9 Aug. 2017, Available here.
3. “Distributed Version Control.” Wikipedia, Wikimedia Foundation, 27 Mar. 2019, Available here.

Image Courtesy:

1. “version control” By Sean MacEntee (CC BY 2.0) via Flickr

About the Author: Lithmee

Lithmee holds a Bachelor of Science degree in Computer Systems Engineering and is reading for her Master’s degree in Computer Science. She is passionate about sharing her knowldge in the areas of programming, data science, and computer systems.

Leave a Reply