Home » The Mini-Monorepo. Maximize code reuse whereas defending… | by Kraig McFadden | Aug, 2023

The Mini-Monorepo. Maximize code reuse whereas defending… | by Kraig McFadden | Aug, 2023

by Icecream
0 comment

Maximize code reuse whereas defending your area boundaries

Photo by Scott Webb on Unsplash

“Can you revert your final commit and use that third-party Dynamo locking library as an alternative?”

My crew lead checked out me along with his sharp, blue eyes. They have been tucked beneath a robust forehead and simply seen over a big auburn beard. It gave him a everlasting expression of seriousness.

“Why’s that?” I requested earnestly. I used to be slightly over a 12 months into my first job, and I had simply obtained an AWS certification. I used to be keen to place it to good use, beginning by utilizing Dynamo’s conditional writes on this library I used to be engaged on.

“I would like us to do away with as a lot of our personal code as we are able to. With three groups touching this monorepo, it’s too simple so as to add dependencies throughout tasks. That’s what received us into this mess.”

I used to be shocked by his reply. I anticipated him to say, “We don’t belief your code as a lot as we belief this third occasion,” which was a priority I used to be able to dispute. I had my counterpoints all lined up. I used to be not, nevertheless, ready to object to dependency considerations. Truth be advised, I hadn’t even realized there have been dependency considerations.

The issues weren’t laborious to see after he pointed them out, although. We did have a multitude, and it was prompted primarily by poor dependency administration. We had companies relying on packages that ought to’ve been inner to different companies, thereby breaking encapsulation. This meant that adjustments to the bundle may trigger unintended penalties to the service that took on the dependency.

Suddenly, the engineer engaged on that bundle needed to be conscious that there was one other dependent and had to ensure to replace each companies to accommodate adjustments to the bundle. Sometimes this additionally meant that each companies wanted to be deployed concurrently to forestall any breakages to the contracts between them.

We had by chance created a tightly-coupled mud ball the place each change prompted ripple results, and each deploy required deploying all of the companies within the monorepo on the identical time. The extra code we added, the harder it grew to become to make adjustments or to deploy.

You may also like

Leave a Comment