This explains SQL stored procedures and their advantages.

  • wvenable@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    This my hot take: Do not use stored procedures with applications. Keep your data separate from your code.

    • AlecSadler@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Could you explain more? Almost everywhere I’ve worked from Fortune 250 on down has used stored procedures with applications and it seems extremely clean and performance-oriented.

      If anything, it separates code from the data more as far as I can tell, so maybe I’m missing something?

      Also, if something is somewhat data driven and there’s a bug, you simply alter a procedure versus doing a build and deploy of the entire application.

    • Distributed@lemmy.ml
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      1 year ago

      Whats your preferred method of accessing sql, in that case? Most companies I’ve worked for use sprocs. ORM?

      • wvenable@lemmy.ca
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Direct queries and ORM. A stored procedure doesn’t provide much value as a unit of abstraction that couldn’t just exist in the code.