2

I have got a dilemma related to DDD (Domain Driven Design).

Let’s simplify the description and assume we have 3 domain. For every domain there are dedicated collections in database. Let’s assume:

  1. 1st domain is covered by team 1 that chosen for solution to persist data in document datase e.g. MongoBD or ArangoDB
  2. 2nd team is in charge of second domain and based on requirements they chosen Elastic Search.
  3. 3rd team has chosen Oracle that seems to be best suited for last domain.

Throughout the implementation of application there is growing need for complex search functionality using attributes that are spread in above different domains, e.g.:

Find all information where DomainA.SomeInformation = "Filter 1" and/or DomainB.AnotherInformation = "Filter 2" and/or DomainC.AnotherInformation = "Filter 3".

Remarks:

  • maybe there should be complex read model that gathers all information within one model e.g. using CQRS – domains exchange information e.g. via message channels so information could be synchronized into Read Models
  • advantages: above case allows to introduce polyglot persistence, every team delivers autonomous modules
  • challenge: maybe there is issue with proposed bounded contexts and domains are separated in a wrong way.

How to cope with above case, where domains seems to be separated properly but on the other time searching for data is challenging since there is not single source of information.

komizo
  • 1,052
  • 14
  • 21
  • Just for the sake of clarification: domain is what your business does. It is the problem space. It cannot have "databases" or anything like this. If you have an application, a service, or whatever technical - it is not a "domain". – Alexey Zimarev Feb 20 '20 at 21:40

1 Answers1

1

https://youtu.be/CCX8Sox6BNQ?t=1430

Check out some insights how it can be achieved from Udi Dahan. The idea is that every microservice will filter the data, cause the data is owned by it. Then the engine (infra) would aggregate the responses and compose them back on UI.

If there is a very complex logic going on between the data, i.e get data from service A by filter, then if result is this, grab data A from service B, if not, then data B from Service C, consider Data warehouse and decision support techniques.

DmitriBodiu
  • 1,120
  • 1
  • 11
  • 22