# Codebase

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Codebase
> Markdown URL: https://mediated.wiki/source/Codebase.md
> Source: https://en.wikipedia.org/wiki/Codebase
> Source revision: 1338525549
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Collection of source code maintained as a unit

This article is about the source code of software systems. For the homonymous database management system, see [CodeBase](/source/CodeBase).

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Codebase" – news · newspapers · books · scholar · JSTOR (October 2014) (Learn how and when to remove this message)

A **codebase** (or **code base**) is a collection of [source code](/source/Source_code) that is maintained as a unit. Typically, it is used to [build](/source/Software_build) one or more [software components](/source/Software_componentry) including [applications](/source/Application_software) and [libraries](/source/Library_(software)).

A codebase is often stored in a [source control](/source/Source_control) repository of a [version control system](/source/Version_control_system). A repository can contain build-generated files (which are therefore not source code), but typically such files are excluded from a repository, and therefore the codebase. A repository may contain data files (such as configuration) that are required for building or running the resulting software. But version control is not a required aspect of a codebase. Even the [Linux kernel](/source/Linux_kernel) was maintained without version control for many years.[1]

When developing multiple components, a choice is made either to maintain a separate, distinct codebase for each, or to combine codebases, possibly in a single, monolithic codebase. With a monolithic codebase, changes to (i.e. [refactoring](/source/Refactoring)) multiple components can often be easier and robust. But this requires a larger repository, and makes it easier to introduce wide-ranging [technical debt](/source/Technical_debt).[*[dubious](https://en.wikipedia.org/wiki/Wikipedia:Accuracy_dispute#Disputed_statement) – [discuss](https://en.wikipedia.org/wiki/Talk:Codebase#Dubious)*] With separate codebases, each repository is smaller and more manageable. The structure enforces logical separation between components, but can require more build and runtime integration between codebases, and complicates changes that span multiple components.[2][3][4]

## Examples

Some notably large codebases include:

- [Google](/source/Google): monolithic, 1 billion files, 9 million source code files, 2 billion lines of source code, 35 million commits in total, 86 TB total size (January 2015)[5]

- [Facebook](/source/Facebook): monolithic, 8 GB (repo 54 GB including history, 2014),[6] hundreds of thousands of files (2014)[3]

- [Linux kernel](/source/Linux_kernel): distributed,[7] over 15 million lines of code (as of 2013[\[update\]](https://en.wikipedia.org/w/index.php?title=Codebase&action=edit) and kernel version 3.10)

## See also

Look up ***[codebase](https://en.wiktionary.org/wiki/codebase)***, ***[code base](https://en.wiktionary.org/wiki/code_base)***, ***[codebases](https://en.wiktionary.org/wiki/codebases)***, or ***[code bases](https://en.wiktionary.org/wiki/code_bases)*** in Wiktionary, the free dictionary.

- [Codeplex](/source/Codeplex)

- [Comparison of free software hosting facilities](/source/Comparison_of_free_software_hosting_facilities)

- [FishEye (software)](/source/FishEye_(software))

- [Forge (software)](/source/Forge_(software))

- [List of free software project directories](/source/List_of_free_software_project_directories)

- [List of revision control software](/source/List_of_revision_control_software)

- [Snippet (programming)](/source/Snippet_(programming))

- [SourceForge.net](/source/SourceForge.net)

## References

1. **[^](#cite_ref-1)** ["A Short History of Git"](https://git-scm.com/book/en/Getting-Started-A-Short-History-of-Git). *git-scm.com*. Retrieved October 21, 2014.

1. **[^](#cite_ref-googledebt_2-0)** J. David Morgenthaler; Misha Gridnev; Raluca Sauciuc & Sanjay Bhansali (2012). ["Searching for Build Debt: Experiences Managing Technical Debt at Google"](https://research.google.com/pubs/pub37755.html). *Proceedings of the Third International Workshop on Managing Technical Debt*. IEEE. pp. 1–6. [doi](/source/Doi_(identifier)):[10.1109/MTD.2012.6225994](https://doi.org/10.1109%2FMTD.2012.6225994).

1. ^ [***a***](#cite_ref-facebookmercurial_3-0) [***b***](#cite_ref-facebookmercurial_3-1) ["Scaling Mercurial at Facebook"](https://code.facebook.com/posts/218678814984400/scaling-mercurial-at-facebook/). *Facebook Code*. 2014-01-07. Retrieved 29 April 2016.

1. **[^](#cite_ref-4)** ["Git - Distributed Workflows"](https://git-scm.com/book/en/Distributed-Git-Distributed-Workflows). *git-scm.com*. Retrieved 29 April 2016.

1. **[^](#cite_ref-5)** Potvin, Rachel; Levenberg, Josh (24 June 2016). ["Why Google stores billions of lines of code in a single repository"](https://doi.org/10.1145%2F2854146). *Communications of the ACM*. **59** (7): 78–87. [doi](/source/Doi_(identifier)):[10.1145/2854146](https://doi.org/10.1145%2F2854146).

1. **[^](#cite_ref-6)** @feross (April 24, 2014). ["Facebook's git repo is 54 GB"](https://twitter.com/feross/status/459259593630433280) ([Tweet](/source/Tweet_(social_media))). Retrieved 29 April 2016 – via [Twitter](/source/Twitter).

1. **[^](#cite_ref-7)** Sproull, Lee; Moon, Jae Yun (2000-11-05). ["Essence of distributed work: The case of the Linux kernel - Moon - First Monday"](http://www.firstmonday.org/ojs/index.php/fm/article/view/801/710). *[First Monday](/source/First_Monday_(journal))*. **5** (11). Retrieved 29 April 2016.

---
Adapted from the Wikipedia article [Codebase](https://en.wikipedia.org/wiki/Codebase) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Codebase?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
