← Back to context

Comment by codeulike

2 days ago

I'm trying to work out why 'views can help you see whats going on in your database' has got to the front page of HN. Is it that we've had a whole generation grow up with ORMs and so only people over 50 know how to actually use a RDBMS?

This is one thing I liked about my uni course back in the day. One of the assignments was to build an entire application within SQL (using triggers, stored procedures, etc) and very minimal bindings to a skeleton written by the professor. It's impressive how much you can do with just Postgres or MySQL

Not over 50, but yes. People are deathly afraid of using RDBMS features, like triggers, events, etc.

  • I’m finally waking up to how great views are for building abstractions within the database. They’re not as versatile as actual code, but still worth thinking about.

    Triggers, however… as the years have gone by, I like triggers less and less. Triggers for complex validation are ok, but triggers that mutate data are a code smell. Our database contains some triggers that denormalize data to make some queries faster, and they’ve proven to be an endless source of problems.

    • I use sql, views, sps and sql functions a lot but wouldnt touch database triggers with a bargepole I totally agree there