Open BenMorel opened 5 years ago
Note: instead of just choosing between the relational or document model for a given entity, it could also be interesting to have the option to save a single entity to both a set of relational tables, and a denormalized JSON table.
The database could contain both models simultaneously: a relational write model, and a denormalized read model.
The ORM could handle transparent persistence to both models.
Several databases now have first-class support for JSON, allowing to store whole entities as JSON documents, like in a NoSQL database.
We do have support for individual JSON columns, but it would be interesting to add support to store a whole entity (all properties) as a single JSON column.
The table would look like:
It should be possible to mix entities mapped in a typical object-to-relational way, and entities mapped to JSON, in the same application, with support from this library.