Business Logic: Database or Application Layer

前端 未结 24 3349
春和景丽
春和景丽 2020-11-28 02:50

The age old question. Where should you put your business logic, in the database as stored procedures ( or packages ), or in the application/middle tier? And more importantly

24条回答
  •  时光说笑
    2020-11-28 03:25

    It is nowadays possible to submit to subversion your stored proc code and to debug this code with good tool support.

    If you use stored procs that combine sql statements you can reduce the amount of data traffic between the application and the database and reduce the number of database calls and gain big performance gains.

    Once we started building in C# we made the decision not to use stored procs but now we are moving more and more code to stored procs. Especially batch processing.

    However don't use triggers, use stored procs or better packages. Triggers do decrease maintainability.

提交回复
热议问题