The Book of DevOps Patterns : #3 — Single or multi-repository pattern

The Book of DevOps Patterns is a long series of patterns used by DevOps. Each story is introduced in a synthetic way by going to the essential.

When setting up a Git repository, one question you have to answer: is it better to set up a large repository gathering all the elements of the application or several specialized repositories?

Before to talk about that, it’s important to note that the answer may depend on the nature of the potential repositories:

  • platforms (such as the Web, iOS, Android),
  • microservices,
  • types (source code, configuration files, tutorials, …).

The advantages of the multi-repository pattern are :

  • reducing the size of the repository,
  • reducing the risk of uncontrolled or involuntary changes in the code base of teams on other platforms.

The advantages of the single-repository pattern are :

  • grouping in one location the elements of the release,
  • simplification for the alignment of the code of the different microservices.

For microservices, the central question is to know how to manage dependencies between services or APIs. The concept of git sub-module addresses the question of dependency between git repositories. They allow to create links between repositories and to retrieve within a repository a copy of the state of another repository.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store