Local vs Centralized vs Distributed
Not all Version Control Systems are built the same. Understanding their architecture is key to understanding how DevOps teams collaborate.
1. Local Version Control
The simplest form. A database on your local computer tracks changes.
- Pros: Very fast; no network required.
- Cons: Impossible to collaborate; if the local computer dies, everything is lost.
2. Centralized Version Control (CVCS)
A single central server contains all versions of the code. Developers "check out" a single version (snapshot) to work on.
- Examples: Subversion (SVN), CVS, Perforce.
- Pros: Easy to manage; strict control over who can branch/commit.
- Cons: Single point of failure (if the server is down, no one can work/commit); high network dependency.
3. Distributed Version Control (DVCS)
Every developer has a full "clone" of the entire repository—including the complete history.
- Examples: Git, Mercurial, Bazaar.
- Pros: Offline work is fully supported; no single point of failure (every clone is a backup); extremely fast branching and merging.
- Cons: Large repositories can take a long time to clone initially.
[!IMPORTANT] The Key Difference In a Centralized system, you only have a slice of the code. In a Distributed system, you have the entire history on your machine. This makes searching logs and switching branches instant.