It's really the case that Git is terrible at scale. Honestly most source control is.
When you have teams of 10,000+ people working on code, if you wanted to shard it, it will be lots of little projects, then you're going to have dependency hell. The core in for teams will either have to spend most of their time upgrading everyone's packages, our other teams are going to have to deal with those upgrades.
The core infra teams are either supporting lots of versions all at once, or spending extra time on source control.
I don't know about Uber, but at Google the monorepo is absolutely amazing.
I will the one big issues that is really hard in a monorepo, if you want to upgrade some external library not built by Google, when that library has a large breaking API change, it will never get upgraded.
That doesn't counter my point - yes there'll be dependency hell but at the same time fundamental developer tools like code intelligence or basic git operations take eons to complete or need strange workarounds
So code infra/library team benefit from monorepos but at the same time most other developers have to suffer
I don't know about Google but monorepos I've worked in are painful and far from ideal dev experience
this was always the nice thing at amazon, because you never needed an atomic migration with version sets.
it was definitely a case of making many things worse to do than in a monorepo, but more things viable to do.
It should be sharded per team.
I think many shops made the mistake of sharding per deployment unit or compilation unit of a larger whole. My first exposure was sharding per executable file of a firmware image. That's just terrible. You can't coordinate changes that you want to be atomic in the firmware image.
In response I think some people went to monorepo to get atomic change sets but now they're too big. If you have an android app team and a backend team, and they don't deploy together or build together or do anything together besides agree on an API, which has to be backwards compatible anyway because apps don't instantly self-update, there's no need to put those things together if it causes headaches. It's probably better to have too many things together than too few, but neither is ideal.