sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

Add more detail to using your own PostgreSQL server doc #16473

Closed macraig closed 3 years ago

macraig commented 3 years ago

Customer message:

Hi SourceGraph friends, I started looking at upgrading our clusters to 3.21, and I want to confirm if using one PostgreSQL RDS instance with separate schemas (one for the frontend data and another for the code intelligence data) is supported. Looking at the documentation for Using your own PostreSQL server, I don't see any environment variable for configuring a schemas so I'm guessing its not supported, right ?

Context to add in doc (taken from Slack answer):

Although I think it is technically possible to point both at the same PostgreSQL RDS DB instance, I would suggest either:

  1. Deploy codeintel-db alongside the other Sourcegraph containers, i.e. not as a managed Amazon RDS instance.
  2. Deploy a separate amazon RDS instance. The primary reason to not use the same Postgres instance for this data is because precise codeintel data (if customer begins using it for a lot of repos) takes up quite a lot of space and you won't want the performance of that DB to otherwise impact the performance of the general application DB - you'll want to be able to scale their resources independently. The codeintel-db data is a bit like the search index data we store on-disk via the deploy-zoekt-indexserver.sh containers - the only difference is that since it is uploaded via e.g. CI systems if the data does get completely lost Sourcegraph can't automatically rebuild it from the repositories (you'd have to wait until it is re-uploaded from your CI systems), so having backups here is a good idea in general.
github-actions[bot] commented 3 years ago

Heads up @macraig - the "team/code-intelligence" label was applied to this issue.

macraig commented 3 years ago

Solved by https://github.com/sourcegraph/sourcegraph/pull/23716