So... It's like a join, but with two queries instead of one, and you push the join data to the webserver, which brings us back to the start of this comment thread...
Even if I were using a relational database, I would still separate out my different domains (drivers, terminals, stops, etc.) into different classes/microservices and join the different entities in memory.
This would allow different developers, teams etc. to focus on separate business objects and would allow you to start off with a monolithic code base/app and separate the app out to microservice later without intertwined logic and to mix and match storage based on what makes sense.
I never said always embed everything into one document. I said think through your aggregate roots to decide how to design your apps and your document model.
I've designed this way for the last 10 years - 9 using RDMSs. I don't do complex 10 way joins for apps. I separate out business domain logically and let each module be responsible for its own domain and then have an overarching orchestrating class that combines the various objects when needed.
That hits home. There's a lot of this in the legacy code base, and yeah, it's painful.
Interesting approach. Thanks for the discussion. I'll have to ponder this a while.
https://martinfowler.com/bliki/DDD_Aggregate.html
If you look at this from a Domain Driven Design standpoint, you should model your business and think about your aggregate roots and each collection should be its own aggregate root, data access should be handled by one class/microservice for each aggregate root.
If you modeled your Domain correctly that wouldn't be an issue.
On the other hand, not modeling your domain correctly first would lead to an ungodly, untestable, tangle of stored procedures and 10 way joins with A relational database.
The Mongo docs goes into best practices which mirrors basically the concept of an aggregate root.
https://www.mongodb.com/blog/post/thinking-documents-part-2