Why is a data layer used while we can write most of the code in stored procedures itself? What are the advantages and disadvantages in it?
Data layer
is an important layer in 3 tier architecture
, which handles all the database related tasks. My question is that, whether we can achieve this using a stored procedure itself in most of the cases? In that case, what is the major advantage in using that layer?
EDIT:
The question was just to get clear idea about the usage of data layer and database stored procedures. I have got an answer below which helped me in that.
The 3-tier approach is for when you wish to maybe use different Database Engine types.
From Multitier architecture