- Learning PostgreSQL 11
- Salahaldin Juba Andrey Volkov
- 217字
- 2021-07-02 13:11:38
Semantic constraints
Integrity constraints or business logic constraints describe the database application constraints in general. These constraints are either enforced by the business logic tier of the application program or by SQL procedural languages. Trigger and rule systems can also be used for this purpose. For example, the customer should have at most one active service at a time. Based on the nature of the application, one could favor using an SQL procedural language or a high-level programming language to meet the semantic constraints, or mix the two approaches.
The advantages of using the SQL programming language are as follows:
- Performance: RDBMSes often have complex analyzers to generate efficient execution plans. Also, in some cases such as data mining, the amount of data that needs to be manipulated is very large. Manipulating the data using procedural SQL languages eliminates the network data transfer. Finally, some procedural SQL languages utilize clever caching algorithms.
- Last-minute change: For SQL procedural languages, one could deploy bug fixes without service disruption.
Implementing business logic in the database tier has a lot of pros and cons and it is a highly contentious topic. For example, some disadvantages of implementing business logic in the database are visibility, developer efficiency in writing code due to a lack of proper tools and IDEs, and code reuse.
推薦閱讀
- 自己動手寫搜索引擎
- Python高級編程
- 編寫高質量代碼:改善C程序代碼的125個建議
- C#程序設計
- C語言程序設計同步訓練與上機指導(第三版)
- SQL Server 2016數據庫應用與開發
- 硅谷Python工程師面試指南:數據結構、算法與系統設計
- 微服務架構深度解析:原理、實踐與進階
- Mastering Business Intelligence with MicroStrategy
- R數據科學實戰:工具詳解與案例分析
- Julia 1.0 Programming Complete Reference Guide
- .NET 4.5 Parallel Extensions Cookbook
- 汽車人機交互界面整合設計
- 高效使用Greenplum:入門、進階與數據中臺
- Hands-On Dependency Injection in Go