B
B
bro-dev2019-04-30 23:24:39
Software design
bro-dev, 2019-04-30 23:24:39

How to avoid code duplication in microservice architecture?

How to avoid code duplication in microservice architecture?
A simple example 2 services use one database and one table, I have an orm model for 1 screen of code, and what should I do without copy-paste so that it is both there and there, so that when you need to add a method to the model, you don’t have to follow all the copies yourself .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Romashkan, 2019-05-09
@EvgeniiR

How to avoid code duplication in microservice architecture?

Do not put the same logic in different microservices, properly separate their boundaries
The borders are clearly drawn incorrectly.
It's not even SOA, it's a monolith that communicates via API, so a logical
question - why do you need a division into microservices?

M
Maxim Fedorov, 2019-04-30
@Maksclub

how can I do without copy-paste so that it is both there and there, so that when you need to add a method to the model, you don’t have to follow all the copies yourself

put this entity (or a set of such) into a package or module, that is, the entity represents a certain domain, pull this domain in each microservice

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question