Business Logic: Database Vs Code

Hi All, I was sitting one day and wondering one day which would be more suitable to write your business logic in code or database let's see the pros & cons

Database

Pros:

If you need to change the language, almost all logic will be in the database; therefore, the implementation time will be minimal.

Changes in the language are more common than in the database.

Cons:

You can’t debug in database

Direct involvement of the database is not a good practice

Code:

Pros:

You can debug the code

scalability

Provide one more layer to the database

Cons:

You need to change whole code if you taking new Tech stack

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vineet Mishra

Vineet Mishra

Full Stack Developer at CCR Tech, I write about Mobile/Web Development and Deployment, and Interview Q & A