6 ms·
BTW we can use stored procedures in SQL which provides many benefits. It is often forgotten.
by lkuty 9y ago
BTW we can use stored procedures in SQL which provides many benefits. It is often forgotten.
- knocte 9y agoHaha, no please, no business logic in the DB in this decade.
- Xylakant 9y agoInstead write a micro service on top of it that holds all the domain knowledge about how the data is structured in the storage layer? Stored procedures are not necessarily business logic, they can be an abstraction layer over the underlying structure, so yes, that can quite well make sense to place it in the DB.
- knocte 9y agolol, go back to your cave
- dotancohen 9y agoHow do you version control that? EDIT: To those mentioning migrations, note that reviewing migrations are like reviewing patches. Sometimes you want to not review a specific patch but rather look at the whole method, and `blame` a specific line or three to get an idea of what the previous developer's intention was. You can't get that type of overview from reviewing each patch or migration.
- matthewmacleod 9y agoI have a system with a lot of logic in the database / the schema is maintained with one of our Rails apps, using the traditional migration tools. It’s pretty awesome.
- mike-cardwell 9y agoNot the OP, but db migrations in git would be one obvious and simple method.
- camus2 9y agoDB migrations.
- GenericsMotors 9y agoIndeed! They are usually my preferred why of interacting with the DB when the queries are complex or hold a good amount of logic. Add user-defined table types used as parameters and you've got a good way to pass batches of data too.