News for hackers. Stuff that matters.
Re:Ask HN: What are the pros / cons of using monorepos? by dehrmann on Thursday October 08, 2020 @12:03PM (#24720407)
In mono/mulirepo debates, I frame this as multirepos make hard, scary things hard. Monorepos make it easy to introduce changes that break APIs at deploy time, but are hidden by the atomic commit actually being OK.
Re:Ask HN: What are the pros / cons of using monorepos? by jrockway on Thursday October 08, 2020 @12:17PM (#24720562)
I think API versioning is orthogonal to how you organize your code. If you have multiple repos, then you still have that "atomic commit" where you update the version of the client library and adjust the code to handle the new semantics. It then breaks when you deploy it to production because the server code isn't deployed yet (or vice versa).

Basically, if you make RPCs, breaking up your repositories or combining your repositories doesn't eliminate this problem. It's a separate problem that you have to tackle. The reason it doesn't come up as often as it should is because a lot of code is liberal in what it accepts, and most changes are strictly additive (i.e. it's "add more information to the response", not "remove information from the response", because we're generally pushed in the direction of making our applications do more). But it is something you have to attack head-on. No tool will auto-fix the problems for you.

Re:Ask HN: What are the pros / cons of using monorepos? by seg_lol on Thursday October 08, 2020 @12:39PM (#24720849)
> API versioning is orthogonal to how you organize your code

They are, but they aren't, because we have to basically increment two counters when things change. If you want to be statically correct, you now have a distributed transaction to update both systems.

There is some path through a call graph (in-proc and rpc) that is statically valid. Then there are duck-typed results that are only additive, which you are describing. Provided the system can handle this (dictionaries over structs). You see this in protobuf and other static centric serialization systems. They start to encode dynamic information using the static building blocks. GCCs internal IR is like this. I think what you are advocating for only applies to the domain of microservices, loosely connected using languages and formats that are open under union. Other systems without those properties will not fare so well.

The folks using the monorepos probably don't disagree, but having atomic commits with hashes makes the identity function a useful crutch. I believe there are other solutions where the VCS could actually make this problem a non-issue.

Re:Ask HN: What are the pros / cons of using monorepos? by taeric on Thursday October 08, 2020 @12:28PM (#24720698)
I think they were referring to a false atomic commit to the front and back end. In a mono repo, that can be one commit. However, it has to be two deploys, so it should have been two commits.

At least, that is my argument. So, I could be reading my view into it. :)

Re:Ask HN: What are the pros / cons of using monorepos? by ali92hm on Thursday October 08, 2020 @11:55PM (#24726642)
> Basically, if you make RPCs, breaking up your repositories or combining your repositories doesn't eliminate this problem. I kinda agree with this.

But as someone who has always worked in a microservice environment kept by different git repos I don't understand the benefits of a mono repo. I can see the benefits of a mono repo in a massive code base that produces a binary at the end (i.e. windows). But could you elaborate more on the benefits of a mono repo in the case of many small microservices?