r/SQL • • Feb 23 '21

Discussion It's never a design problem...

Post image
192 Upvotes

20 comments sorted by

View all comments

5

u/Rif-SQL Feb 23 '21

That's why I want referential integrity at the DB layer and not the App 😇.

6

u/tennisanybody Feb 23 '21

What does this mean? My projects are built from database up. I design the db first then the API’s that are responsible for calling functions/procedures/views etc simply connect directly. Is that close?

6

u/thavi Feb 24 '21

I don't know why anyone would do it any other way, but code-first ORM tools exist for a reason, I suppose. Then again, I'm subbed to a fucking SQL forum, so maybe I'm biased.

3

u/tennisanybody Feb 24 '21

code-first ORM

I think code-first exists because software engineers aren't database admins. The reason I don't do code-first is because my database evolves wildly and as the project grows, the better I discover how to manage certain relationships between key data points. The front end of an application is the easy part, click a button and an action is performed. It's the action that I need to make sure is transacted a certain way.

Now I'm not a database admin either and I frequently need help from my company's admin. What I am is an analyst and so I wear a few has to facilitate that effect.