Skip to main content
added 370 characters in body
Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157

A RDBMS is a great piece of software that do a lot of things beyond just putting data into data files.

I will not enumerate here the functions of a RDBMS, but you may guess you would need to write tomes of code just to emulate a tiny fraction of what it can do.

It's no longer one-app<->one-database world.

Several apps can access the same database, and one single app can access several databases. So trying to enforce all referential integrity and permissions in "the app" makes me ask "what app?, the Android one?, the iPhone one?, the Web one?, the desktop one?, etc". There are scores of ways a database user can access a database. "The app" is just one of them.

The RDBMS should enforce referential integrity, control access to objects, etc. If you want to do the same in "the app", good, cause you will save a trip to the database but I recommend that you do that cost-effectively and not as a rule.

The DAL should capture exceptions and act accordingly.

And other thing: how do you plan to keep your DAL in sync with database permissions?

In databases, users are being created all the time and permissions are being granted and revoked all the time, how will the DAL generate code to reflect that?

A temporary junior DBA could help. Maintenance of a codebase is costly. The more code is business layer oriented or final user oriented, the better. Investing programming time in mundane tasks as making sure no duplicates are inserted in PK-less tables or a non-related row inserted in a FK-less table is a waste of developer's time. Programmer's time is expensive.

A RDBMS is a great piece of software that do a lot of things beyond just putting data into data files.

I will not enumerate here the functions of a RDBMS, but you may guess you would need to write tomes of code just to emulate a tiny fraction of what it can do.

It's no longer one-app<->one-database world.

Several apps can access the same database, and one single app can access several databases. So trying to enforce all referential integrity and permissions in "the app" makes me ask "what app?, the Android one?, the iPhone one?, the Web one?, the desktop one?, etc". There are scores of ways a database user can access a database. "The app" is just one of them.

The RDBMS should enforce referential integrity, control access to objects, etc. If you want to do the same in "the app", good, cause you will save a trip to the database but I recommend that you do that cost-effectively and not as a rule.

The DAL should capture exceptions and act accordingly.

And other thing: how do you plan to keep your DAL in sync with database permissions?

In databases, users are being created all the time and permissions are being granted and revoked all the time, how will the DAL generate code to reflect that?

A RDBMS is a great piece of software that do a lot of things beyond just putting data into data files.

I will not enumerate here the functions of a RDBMS, but you may guess you would need to write tomes of code just to emulate a tiny fraction of what it can do.

It's no longer one-app<->one-database world.

Several apps can access the same database, and one single app can access several databases. So trying to enforce all referential integrity and permissions in "the app" makes me ask "what app?, the Android one?, the iPhone one?, the Web one?, the desktop one?, etc". There are scores of ways a database user can access a database. "The app" is just one of them.

The RDBMS should enforce referential integrity, control access to objects, etc. If you want to do the same in "the app", good, cause you will save a trip to the database but I recommend that you do that cost-effectively and not as a rule.

The DAL should capture exceptions and act accordingly.

And other thing: how do you plan to keep your DAL in sync with database permissions?

In databases, users are being created all the time and permissions are being granted and revoked all the time, how will the DAL generate code to reflect that?

A temporary junior DBA could help. Maintenance of a codebase is costly. The more code is business layer oriented or final user oriented, the better. Investing programming time in mundane tasks as making sure no duplicates are inserted in PK-less tables or a non-related row inserted in a FK-less table is a waste of developer's time. Programmer's time is expensive.

Source Link
Tulains Córdova
  • 39.6k
  • 13
  • 102
  • 157

A RDBMS is a great piece of software that do a lot of things beyond just putting data into data files.

I will not enumerate here the functions of a RDBMS, but you may guess you would need to write tomes of code just to emulate a tiny fraction of what it can do.

It's no longer one-app<->one-database world.

Several apps can access the same database, and one single app can access several databases. So trying to enforce all referential integrity and permissions in "the app" makes me ask "what app?, the Android one?, the iPhone one?, the Web one?, the desktop one?, etc". There are scores of ways a database user can access a database. "The app" is just one of them.

The RDBMS should enforce referential integrity, control access to objects, etc. If you want to do the same in "the app", good, cause you will save a trip to the database but I recommend that you do that cost-effectively and not as a rule.

The DAL should capture exceptions and act accordingly.

And other thing: how do you plan to keep your DAL in sync with database permissions?

In databases, users are being created all the time and permissions are being granted and revoked all the time, how will the DAL generate code to reflect that?