This question was brought up today as I talked with a dev that likes stored procedures. I like SQL (and I also like NoSQL just to be clear), but I’ve never been comfortable with stored procedures as I (and yes I might be wrong) I don’t like separating the logic down to the database layer – adding what I consider a second data access layer- and I don’t like creating procedures ‘beforehand’. I’m a girl, I tend to change my mind. One minute I want red hair, other minute I want red hair with blue stripes. I want to be able to fix my hair at home, and not have to run to the hairdresser to get it done. My hair will definite constantly change as I ‘evolve’.
As for the performance gain, I’ve been told that the performance win isn’t that big anymore (and how early on should I optimize anyway?), and as for SQL injection I always use parameterized queries (who doesn’t today?);
This might be an utterly silly thought/reasoning, and I am guessing that there’s a big It Depends attached to this question. Nonetheless, I want to, as always, know what it depends on – if you think it depends. After all, I would love to be wrong and learn something new today 🙂
So: Does it depend or is there a right or wrong? And does the size of the application complexity of the data change this?