How to shard git servers?

465 views Asked by At

I have N git repositories that I want to shard across M git servers behind a load balancer, but I'm not sure how to do this.

For example, if I'm on Client 1

git push foo master

should to push to server A, and on Client 2

git push bar master

to push to server B.

Where git remote -v on Client 1 shows

foo     https://git.example.com/foo.git/ (fetch)
foo     https://git.example.com/foo.git/ (push)

and git remote -v on Client 2 shows

bar     https://git.example.com/bar.git/ (fetch)
bar     https://git.example.com/bar.git/ (push)

Normally, if I were sharding a database, I would modify my application code to point to a different database depending on the request, but in this case, I don't have any application code nor a database. I'm just using the git-http-backend provided by git which uses the local filesystem.

Is there a simple way of routing certain repositories to certain machines without giving each repository a different subdomain?

0

There are 0 answers