|
|
|
|
|
by scarface74
3189 days ago
|
|
Stored procedures are bad in so many ways - they harder to deploy and revert than code, harder to unit test* , harder to refactor and every implementation that I have ever seen that has business logic in stored procedures instead of microservices/packages/modules have been a nightmare to maintain. * At least with .Net/Entity Framework/Linq you mock out your dbcontext and test your queries with an in memory List<> https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113).... |
|
Agree.
> harder to unit test
Disagree. I've implemented unit tests that connect to the normal staging instance of our database, clone the relevant parts of the schema into a throw-away namespace as temporary tables, and run the tests in that fresh namespace. About 100 lines of Perl.
That was five years ago. These days, it's even easier to do this correctly since containers allow you to quickly spin up a fresh Postgres etc. in the unit test runner.