[QUESTION] Model relationships between domains.
I would just like some clarity on this. The user guide states that UUID fields should be used for model relationships, and that Services should control the relationship between models.
If a relationship spans multiple tables, say: Book -> Author -> Organisation -> Address, does this mean we would need to execute 4 SELECT queries (through different APIs) if we want a Book's Address, aggregating the results similar to Django's prefetch functionality?
Thanks!
If you have four separate domains and you have that requirement, then yes?
But what if you have that data structure normally with foreign keys and you're doing joins?
That also seems a bit obtuse.
I wonder if there is a more optimal way - creating a BookWithAddress that stores the values together so you're not doing expensive queries all the time, perhaps?
But if you need the list of books (paginated), with the Author, ... and want to order the list by Organization. I can't not see the way of do that.
After reading little more about the matter. I think that a BookWithAddres using cqrs pattern is good choice.