- 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.
推薦閱讀
- JavaScript從入門到精通(微視頻精編版)
- Spring 5企業級開發實戰
- 零基礎玩轉區塊鏈
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- Python語言程序設計
- Android Development with Kotlin
- 數據結構(Python語言描述)(第2版)
- Python進階編程:編寫更高效、優雅的Python代碼
- Django:Web Development with Python
- Clojure Reactive Programming
- Salesforce Reporting and Dashboards
- 深入解析Java編譯器:源碼剖析與實例詳解
- 從零開始學UI:概念解析、實戰提高、突破規則
- Python機器學習與量化投資
- 大話C語言