We have spent enough time discussing how to ensure domain model consistency with explicitly defined business rules. In this chapter, we will go further with persisting our aggregates to the database. Since our model is not being designed around any database, we might encounter issues when trying to get a complex object graph to be stored by using a database engine. That's because the database does not work with objects. Instead, relational databases are optimized to store data in tables that might have relations that use primary and foreign keys. Document databases store objects in machine-readable formats, like JSON, and are, by definition, able to persist complex object graphs as-is; however, we shouldn't fool ourselves, since there are still serious constraints about how these objects need to be organized so that the database client library can...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia