sql - Is querying directly against tables somehow okay now? -
in past, database administrator worth salt have told never query against table directly. in fact, have prevented putting tables in 1 schema & cutting-off direct access schema...thereby forcing query or crud views & procedures etc. , further, protecting data security-layers made sense security perspective.
now enters entity framework...
we use entity framework work. iqueryable king! dbo schema. and, people going directly tables left-and-right because repository patterns , online examples seem encourage practice.
- does entity framework under hood makes practice okay now?
- if so, do?
- why okay now?
help me understand.
- does entity framework under hood makes practice okay now?
ef doesn't change dynamic. convenience of data access , rapid development, not better way data.
- if so, do?
it not. does, think, @ least avoid constructing select * type queries.
- why okay now?
it remains matter of opinion , culture. in general "strict" dba want hit exposed objects layered on top of tables crud. easier tune such queries , maintain control of performance if application using expose custom objects rather using orm or hand-coding direct queries.
imo, orm great rapid protyping , basic stuff, more complex logic or substantial performance should moved custom built objects.
where/when lines vary substantially based on number of things including:
- size/load of database
- availability of database professionals vs app developers
- maturity of company
Comments
Post a Comment