Live data from Hacker News

Google stores billions of lines of code in a single repository (2016) [pdf]

dl.acm.org

101–110 of 209 posts

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#101

Google's code may be a monorepo, but back when I was there you only ever 'checked' out particular projects for editing etc. It's a bit silly to talk about some aspects of Google separated from the whole dev env in there.

With clients in the cloud (CitC) the natural/default is to have a complete view of Piper. No more narrowed clients/explicitly tracked subtrees.

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#102
post #62

Earlier quoted context omitted.

> There's no requirement to have single versions of dependencies in a monorepo. Google allows[0] multiple versions of third-party dependencies such as jQuery or MySQL, and internal code is expected to specify which version it depends on. Sure, but this is unsustainable. If service Foo depends on myjslib v3.0.0, but service Bar needs to pull in myjslib v3.1.0, in order to make sure Foo is entirely unchanged, you'd hav…

> Sure, but this is unsustainable. Not exactly unsustainable considering Google has been very successful with this approach!

Google isn't successful because of their tech decisions. They just happen to make an infinite amount of ad money; everything else they do is mainly getting their engineers to play in sandboxes to distract them so they won't leave to start other ad markets. It works though, since everyone is in love with their complex makework ideas.

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#103

Earlier quoted context omitted.

Not updating old libraries is how you end up getting known security vulns years after they are patched.

You should ask your colleagues who work in critical industries like banking and healthcare how much of their software stack depends on things that haven't been patched in more than 20 years ;)

I know devs in several and you can’t even deploy to QA if a dependency has a known vulnerability.

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#104

Google's code may be a monorepo, but back when I was there you only ever 'checked' out particular projects for editing etc. It's a bit silly to talk about some aspects of Google separated from the whole dev env in there.

With clients in the cloud (CitC) the natural/default is to have a complete view of Piper. No more narrowed clients/explicitly tracked subtrees.

And to be clear CitC is over a decade old, not some new thing.

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#105

There's a lot of love for monorepos nowadays, but after more than a decade of writing software, I still strongly believe it is an antipattern. 1. The single version dependencies are asinine. We are migrating to a monorepo at work, and someone bumped the version of an open source JS package that introduced a regression. The next deploy took our service down. Monorepos mean loss of isolation of dependencies between ser…

After more than a decade of having tiny repos, I strongly believe that monorepos are the right way to go.

When you're pinning on old versions of software it quickly turns into a depsolving mess.

Software developers have difficulty figuring out which version of code is actually being deployed and used.

When dealing with major version bumps and semver pins around different repositories that creates a massive amount of make-work and configuration churn, and creates entire FTE roles practically dedicated to that job (or else grinds away at the time available for devs to do actual work and not just bump pins and deal with depsolving).

In any successful team which is using many dozens of repos, there's probably one dev running around like fucking nuts making sure everyhing is up to date and in synch who is keeping the whole thing going. If they leave because they're not getting career advancement then the pain is going to get surfaced.

The ability to pin also creates and encourages tech debt and encourages stale library code with security vulnerabilities. All that pinning flexibility is engineering to make tech debt really easy to start generating and to push all that maintenance into the future.

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#106

Having worked at Google and Amazon. Honestly their systems are almost identical. Amazon just creates a monotonically increasing watermark outside the “repo”. Google uses “the repo” to create the monotonically increasing watermark. Otherwise, Google calls it “merge into g3” Amazon calls it “merge into live”. Amazon has the extra vocabulary of VersionSets/Packages/Build files. Google has all the same concepts, but just…

Did you work on a team at Google that uses branches? Most teams do not, so there is no "merge into g3".

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#107
post #44

Earlier quoted context omitted.

Context: Staff Eng @ Google for 7+ years 1) This is solved by 2 interlocking concepts: comprehensive tests & pre-submit checks of those tests. Upgrading a version shouldn’t break anything because any breaking changes should be dealt with in the same change as the version bump. 2) Google’s monorepo allows for visibility restrictions and publicly-visible build targets are not common & reserved for truly public interfac…

How do you deal with wanting to see the history, graph etc of just one sub-project? Does the tooling handle this?

History for folders is visible in code search, it’s basically equivalent to what GitHub or Sourcegraph would give you. You can query dependencies from the build system. Anything beyond a couple levels deep is unlikely to load in any tools you have ;)

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#108
post #62

Earlier quoted context omitted.

> There's no requirement to have single versions of dependencies in a monorepo. Google allows[0] multiple versions of third-party dependencies such as jQuery or MySQL, and internal code is expected to specify which version it depends on. Sure, but this is unsustainable. If service Foo depends on myjslib v3.0.0, but service Bar needs to pull in myjslib v3.1.0, in order to make sure Foo is entirely unchanged, you'd hav…

> Sure, but this is unsustainable. Not exactly unsustainable considering Google has been very successful with this approach!

I suspect Google spends more on developer tooling than any organization of on the planet. Probably worth considering that whenever trying to see whether something would work for you.

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#109

Earlier quoted context omitted.

You should ask your colleagues who work in critical industries like banking and healthcare how much of their software stack depends on things that haven't been patched in more than 20 years ;)

"critical industries like banking and healthcare". What a red herring. This comment reads like ChatGPT was trained on Reddit forums. 99% of the software in those industries runs "inside the moat" where security doesn't matter. I am still running log4j from 10 years ago in lots of my stack, and it is the swiss cheese of software security! Who cares! It works! I'm inside the moat! If people want to do dumb black hat st…

> If people want to do dumb black hat stuff, they get fired.

Firing people doesn’t get you un-hacked. When your risk model involves threats coming from the inside (and at sufficient scale and value it definitely should) then you want to harden things internally too.

Re: Google stores billions of lines of code in a single repository (2016) [pdf]

#110
post #66

Earlier quoted context omitted.

Despite almost everything being in one big repo, it has silos. Not everyone has read access to everything. Some code, like the important bits of Search, is only available on a need-to-know basis.

So what happens if search adopts your internal library and your update to it breaks search? Do you need to get someone from the search team to go investigate? How is that prioritised?

The tooling is such that you will know if a change will break something in a silo before it is submitted. You then work with the affected team. It’s not a big deal.
Post reply on HN