3 ms·
I did qualify my statement with “for simple queries”. For more complicated queries, a pattern I have become quite fond of is making database views and then usi
by toasterlovin 8y ago
I did qualify my statement with “for simple queries”.
For more complicated queries, a pattern I have become quite fond of is making database views and then using them as the backing table for an ORM model. In Rails, at least, this gives you the best of both worlds.
- qaq 8y agoYep that works well for many use cases
- ontologiae 8y agoUsing PostgreSql, I tend now to directly generate query result in json. It implies an architecture model where you put the business logic and type safety in the RDBMS. It reduces the number of layers for a lot of functionalities.
- toasterlovin 8y agoHow does version control work for an architecture like this?
- diegoperini 8y agoIn my experience, migration scripts that include modifications to output JSON (as ALTER TABLE statements) are always tracked and programmed to be auto-executed on each version update.