Live data from Hacker News

We Put Half a Million Files in One Git Repository, Here’s What We Learned

canvatechblog.com

101–110 of 270 posts

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#101
post #33

Earlier quoted context omitted.

Remember back when people recommended commiting node_modules into git?

Ah - that would explain why at my current job there was a node_modules directory in git with nearly 2 million lines of Javascript within. It is gone now.

Ugh

The price of letting less experienced people "go crazy" in the repo

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#102
post #28

I feel like I've read about several big companies using monorepos, but I've never understood why. It feels like the source-control equivalent of writing your code in one big file. Does anyone have any good resources for why and how best to implement a monorepo?

It’s mostly about avoiding code and work duplication. At scale, the waste on duplicate work across teams can be massive (think about setting up CI tooling for example). Mono repo let’s you solve tooling/build problems once and for all. The main drawback is scalability of the tools involved like git.

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#103

It took me a while to find out what Canva actually does, but from https://www.canva.com it appears they are an online design / collab tool. To be fair, that could mean a _lot_ of functionality and code providing a rich, SPA, JS heavy experience. Modern JS frameworks aren't exactly known for being concise. But still, 60 million lines of code and half a million files is a sure sign that someone said at one point "sure,…

> it takes 10 seconds to run git status People coming from the SVN world do not think that this is unusual or problematic. And unfortunately even recently I've seen SVN still in use at large legacy companies.

From my experience SVN isn’t significantly slower than git.

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#105
post #64
post #55

Earlier quoted context omitted.

Sure, how did we ever manage to rename something without monorepos. Oh wait, maybe that's what this "versionning" thing is all about.

Right, it's "I have to send 5 PRs to 5 different repos, get them all cross merged, and then at the end it's wrong anyways so I have to start all over". Multirepo management is extremely frustrating compared to "it's all in the same folder".

What I took away from TFA is that monorepo management at this scale is “extremely frustrating” too.

ISTM that the complexity of managing any repo will be bounded by the size of that repo; a monorepo, being unbounded in size, will, in time, become arbitrarily complex to manage.

While a multirepo might occasionally require developers to apply changes to more than one repo at a time, I’ve never found this to be much more than a minor inconvenience; one that could be solved readily with simple tooling, if we had ever felt that the “problem” was even worth solving.

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#106
post #64
post #55

Earlier quoted context omitted.

Sure, how did we ever manage to rename something without monorepos. Oh wait, maybe that's what this "versionning" thing is all about.

Right, it's "I have to send 5 PRs to 5 different repos, get them all cross merged, and then at the end it's wrong anyways so I have to start all over". Multirepo management is extremely frustrating compared to "it's all in the same folder".

The process you're describing looks like some trial and error PRs...

Multirepo also allows you to roll out that change incrementally instead of big banging all the time.

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#107

They made a bad design decision 10 years ago, have been fighting the fallout for years, and will be doing so forever and ever because things will only ever grow. They wrote a blog post on how clever they think all their workarounds are, at least one of which involves sparse-checkout -- which is perilously close to chopping up your monorepo into several, while still pretending monorepo is fine. I feel like somebody's…

So every company ever? I love these comments like hindsight is not 20/20 and it would have been so simple for you to have made all of the right engineering decisions as an armchair CTO. Give me a break. Git repos get out of control, bad decisions are made, this is an interesting solution and write up. So over the whole “just make perfect decisions all the time and you would never need X comments”. Guess what? Everybody makes mistakes

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#108
post #96
post #83

Earlier quoted context omitted.

What would be a better structure?

monorepo until it becomes too big -> then, splitting it into 2-3 repos, until each one also gets too big to manage...

The problem is not the repository, it’s having the translation data in the repo.

We have the same issue at $dayjob, the repo is quite large and 80% of it is translation data. Even if they compress ridiculously well (99% last I checked) the number of translation files and the number of exports makes them the vast majority of the cost.

However that structure remains a convenient nuisance, and more importantly removing them would really only be useful if we rewrote the entire repository, which breaks all working copies.

There’s been a task in a wishlist for years now, but the business incentive just isn’t there.

Exit: actually the translation files are 80% of the working copy, they’re closer to 90% of the repo, and on the far side.

Re: We Put Half a Million Files in One Git Repository, Here’s What We Learned

#110
post #69
post #34

The fact that Canva has a `Source Control team` with at least 5 people on it (going by the thanks at the bottom of the article), means they should probably try a different approach. I think it's a cool company, with a good product, but they're WAY too small to be having a "source control team" on staff. That's at least 1.2MM a year salary / benefits cost.

It's not exactly a great name for the team but it gets across the point - we handle developer experience from the point you want to push your code to when you merge it, so we also work on communicating with CI/CD, code review/ownership tooling, gitops bots etc. Git Performance is a big issue right now but there's no end in sight to all the other scaling problems we could work on so if it stops making sense, we can wo…

That's fair, and I think you're doing great work. I enjoyed the article
Post reply on HN