6 ms·
code that lives in the database rather than in version-controlled code If you think you can't version control stored procs, then you are doing something badly,
by gaius 10y ago
code that lives in the database rather than in version-controlled code
If you think you can't version control stored procs, then you are doing something badly, badly wrong.
What's the difference between a "script" which is a text file on a filesystem at the end of the day, versus a "stored proc" which is a block of text in a database, loaded off a file in a filesystem?
- jstanley 10y agoThe "script" gets deployed simply and reliably using your existing tooling, and stays in sync with the surrounding code.
- tokenizerrr 10y agoReplace the stored procedure from version control at deploy time.
- azernik 10y agoAnd then you have to make sure your deploys are atomic so that the app code and stored procedures don't get out of sync on failed deploys... Or your stored procedures now become one more thing that has to be backwards compatible, in addition to your DB schema... I've run into all of these problems with stored procedures, and they SUCK. Good deployment tooling can solve them, but it's a lot of effort for questionable reward.
- kofejnik 10y agothis absolutely mirrors my experience
- gaius 10y agoa lot of effort for questionable reward It's a small amount of effort for a thousand-fold increase in performance and not having to re-implement the same functionality in every app and in every language that connects to that DB. YMMV.
- icebraining 10y agoThe argument was between using SQL in stored procedures or SQL in queries sent by the application, so you don't have to re-implement anything (just share the SQL queries between apps), and I very much doubt you'll get a thousand-fold increase in performance.
- spdionis 10y agoThousand-fold increase in performance by shaving off network and query compilation time?