Microservice architecture, does it really encourage copy / paste? -


i'm working in middle size organisation. year started refactor our old solution creating microservices. backend part go chosen, front have node.js

now imagine have html form user puts data. after front end part makes own validation , call 1 of 3 different endpoints (three different microservices).

this validated front end data validated 3 micro services separately. same rules copy/pasted. , there lot of other examples this.

i proposed create validator service perform validation in 1 place , got answer 'in microservices architecture cannot create strong dependencies'

my question if 'strong dependencies' bad need stupid copy/paste , create unit tests copy/pasted code (we copy/paste them , change names). if 'strong dependencies' bad give examples why.

for first question, answer shouldn't ever have "copy/paste" anything, , elimination of "hard" synchronous dependencies between services has nothing it. it's strong sign functional boundaries of monolithic decomposition faulty. question why doing validation on same data 3 separate services when single microservice supposed own , manage own data? also, it's common have near cross-cutting utility-type concerns more 1 microservice may share, , common library (jar in case of java example) not violate intent of architecture. no copy/past needed.

now here why "strong" synchronous dependencies bad idea. intent of microservice architecture deploy new , improved "single/do-one-thing) features production minimum of risk , without adversely impacting performance. enables evolutionary improvement, , accelerates time-to-market of desired features. if new service misbehaves, affects functionality responsible - nothing else. imagine if decompose monolithic application "code-module" rather feature/function. end distributed monolith! not loose advantages , intent of architecture, performance , complexity adversely impacted perhaps fatal degree.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -