3 ms·
Put your business logic in a database and use SQL (not an ORM) to extract and manipulate your business data. Use a supporting programming language to transform
by open-source-ux 5y ago
Put your business logic in a database and use SQL (not an ORM) to extract and manipulate your business data. Use a supporting programming language to transform the data into a presentation suitable for users e.g. a web page.
To make this work well, you must put serious effort into creating a database schema (design) that meets the criteria for normalisation - up to third normal form. Do this even if you later decide to de-normalise.
Some developers are against the idea of placing business logic in a database. But I'd argue that business logic in your database minimises the code in the supporting programming codebase.
Of course, business logic can't always be clearly separated by database and code, but favour the database over the programming code for business logic when possible.