3 ms·
Weird, this is completely opposite to what a lot of people I've worked with have said. What do you think about having business logic in the DB layer too? I saw
by exdsq 7y ago
Weird, this is completely opposite to what a lot of people I've worked with have said. What do you think about having business logic in the DB layer too? I saw someone on another post recommending that which, again to the people I have worked with, is an antipattern.
- vbezhenar 7y agoSomewhat related quote: Linus Torvalds: "Bad programmers worry about the code. Good programmers worry about data structures and their relationships." IMO proper database design is extremely important. Code is fluid. You can replace it. Data is not that fluid, it's much harder to change it. Database should contain checks to ensure that bad data won't be saved. I don't think that complete business logic should be in database. Keep data in database, keep your code in your application. Database is responsible for data storage and some data validation to prevent misbehaved apps storing obviously bad data. Application is responsible for everything else.