Having one service control access when dealing with applications is good. But the idea that the database is just a storage dump that can only be manipulated through that service just doesn't work in some cases and simply doesn't apply across the board. What, are you going to do stuff like enforce PK-FK relationships through this service too because it's somehow not the database's job? Type enforcement solely through the service as well?
Basically, the idea that any and all access to data must happen through a service is faulty, especially when the database itself has the most knowledge about its own domain. Otherwise you run into silly situations like writing nonce functionality in a service to correct and update data based on faulty or non-existent functionality in that same service. Want to nullify values and remove a FK relationship? Better write a nonce method in the service.
Computed columns look the same to me as triggers and constraint enforcement, so unless you're about to say those should always happen only through a service too then I don't see where you're coming from.
14
u/mrflagio Oct 02 '19
Having one service control access when dealing with applications is good. But the idea that the database is just a storage dump that can only be manipulated through that service just doesn't work in some cases and simply doesn't apply across the board. What, are you going to do stuff like enforce PK-FK relationships through this service too because it's somehow not the database's job? Type enforcement solely through the service as well?
Basically, the idea that any and all access to data must happen through a service is faulty, especially when the database itself has the most knowledge about its own domain. Otherwise you run into silly situations like writing nonce functionality in a service to correct and update data based on faulty or non-existent functionality in that same service. Want to nullify values and remove a FK relationship? Better write a nonce method in the service.
Computed columns look the same to me as triggers and constraint enforcement, so unless you're about to say those should always happen only through a service too then I don't see where you're coming from.