Lesson 170 - Managing Code Reuse in Microservices

preview_player
Показать описание
Code reuse is a normal and necessary part of software development. Shared functions such as logging, auditing, authorization, string utilities, data utilities, and the like are part of any architectural style—even Microservices. In this lesson I’ll talk about some of the issues surrounding code reuse in microservices, and show three techniques for code reuse and the trade-offs of each.

Reference Links:

Рекомендации по теме
Комментарии
Автор

How good are those lessons guys. You can see how he manages such a complex topic with simplicity. Real art IMO.

krumbo
Автор

The drawbacks of the last approach can be mitigated by running a shared code not as a single standalone service but as a sidecar for each service. This way, the added latency is negligible and the sidecar is scaled together with its main service (since the sidecar is the part of the service). This approach however increases complexity of the solution.

penaplaster
Автор

Thank you for your content Mark, it really is a joy to watch these complex topics covered so simply, I look forward to every new Arch Lesson episode 🙏
I'm just adding another layer here, but, as with most things in software, the sweetspot will generally be a combination of all these techniques, where you use each in a particular subdomain in a way that aims to maximise (never to 100%) their advantages and minimise (never to 0%) their disadvantages. The system's external forces will also change over time, so the weighting of the three approaches would also fluctuate over time, there's no "one right solution forever more", but a continual process of evolution towards the next, most valuable & achievable, outcome.

barrydev
Автор

The reuse pattern is generally considered as following from the least desirable to highly desirable in a huge microservices-based architecture. Code duplication -> Shared library -> Shared Service/API -> Side Car -> Platform

chachucoder
Автор

Really easy to understand and put across very well!

kurito_
Автор

Then how to choose the approach for code reuse?

sw
Автор

What about if we collect all classes in one common library that uses all microservices ?

aqilaghamirzayev