简体   繁体   中英

What is the best approach in adding projects on a Domain Driven Design DDD having multiple databases?

Solution Projects:

  • API - contains controller and exposes API
  • Application - contains specific business rule only applied for the an API
  • Common - contains constants
  • Domain - it contains the entities which uses the onion architecture of DDD
  • Infrastructure - handles external API transactions
  • Persistence - Domain to Database configuration and mappings

I have a set of projects in my solution (see above) , however, the whole solution transacts to only 1 database. Now, I have a plan to integrate another database, What is the best approach in adding projects on a Domain Driven Design DDD having multiple databases?

Initially, I'm thinking of adding another pesistence project but I'm thinking it will require domains. I'm not sure if it is right to mix the domains mapped with different databases. Can someone tell me how to approach this?

The fact that it's a new database or a new project should not matter at all. You have to translate the functionality into your ubiquitous language and see how that fits into your application now. You'll end up answering questions like: * Is this a new feature or one that complements an existing one * Does this feature even belong in this domain * Are there new entities, aggregates and value types needed to express this feature

All of those DDD questions don't care how serialization happen or doesn't. The specifics of serialization falls outside the purview of your Domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM