ddd-by-examples / library

A comprehensive Domain-Driven Design example with problem space strategic analysis and various tactical patterns.
MIT License
4.92k stars 726 forks source link

Question about DB schema #77

Open sharanrprasad opened 4 months ago

sharanrprasad commented 4 months ago

Hi, I am new to DDD and I am finding this repo very helpful. Just curious about the way one to many relationship between book and patron is handled in DB in lending module. BookOnHold (book_database_entity) entity has byPatron and holdPlacedAt which is a standard way of doing one to many relationship but there is also a PatronHolds (holds_database_entity) entity which pretty much has the same information. Can someone please explain what kind of pattern this is ? Isn't this just duplicating data in DB ?