Sourcegraph Architecture Overview

This is a high level overview of Sourcegraph’s architecture so you can understand how our systems fit together. You can click on each component to jump to its respective code repository or subtree.

The Code intelligence processes (the LSIF-based code intelligence service) has been extracted into its own diagram.

To re-generate the architecture diagram from the architecture.dot file with Graphviz, run: dot -Tsvg -o architecture.svg architecture.dot (and similar for codeintel.dot).

Clients

We maintain multiple Sourcegraph clients:

These clients generally communicate with a Sourcegraph instance (either https://sourcegraph.com or a private customer instance) through our GraphQL API. There are also a small number of REST endpoints for specific use-cases.

Services

Our backend is composed of multiple services:

  • Most are Go services found in the cmd folder.
  • Syntect server is our syntax highlighting service written in Rust. It is not horizontally scalable so only 1 replica is supported.
  • zoekt-indexserver and zoekt-webserver provide indexed search. They are written in Go.

Infrastructure

Guides

Here are some guides to help you understand how multiple systems fit together: