# When the Application Layer Is Disposable: Putting Integrity Constraints Back in the Database

DevFeed: [When the Application Layer Is Disposable: Putting Integrity Constraints Back in the Database](<https://devfeed.tech/articles/when-the-application-layer-is-disposable-putting-integrity-constraints-back-in-the-database-103407.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.36418>)

Author: Hasara Kalumin, Amol Deshpande

Published: 2026-10-28T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Databases](<https://devfeed.tech/sources/arxiv-databases.md>)

Topics: [database-consistency](<https://devfeed.tech/topics/database-consistency.md>), [rdbms](<https://devfeed.tech/topics/rdbms.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [schema design](<https://devfeed.tech/topics/schema-design.md>), [business logic](<https://devfeed.tech/topics/business-logic.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [application](<https://devfeed.tech/tags/application.md>), [applications](<https://devfeed.tech/tags/applications.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [constraint](<https://devfeed.tech/tags/constraint.md>), [cs-db](<https://devfeed.tech/tags/cs-db.md>), [data-management](<https://devfeed.tech/tags/data-management.md>), [database](<https://devfeed.tech/tags/database.md>), [databases](<https://devfeed.tech/tags/databases.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [extension](<https://devfeed.tech/tags/extension.md>), [graphs](<https://devfeed.tech/tags/graphs.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [integrity](<https://devfeed.tech/tags/integrity.md>), [invariants](<https://devfeed.tech/tags/invariants.md>), [keys](<https://devfeed.tech/tags/keys.md>), [llm](<https://devfeed.tech/tags/llm.md>), [mappings](<https://devfeed.tech/tags/mappings.md>), [performance](<https://devfeed.tech/tags/performance.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>)

## AI overview

The paper argues that the database must enforce integrity rules that application code can no longer reliably protect, especially when LLM agents write directly to databases and multi-relation constraints are split across tables. As a first step, it presents constraint indexes: transactional access paths for enforcing cross-relation constraints. A PostgreSQL proof of concept handles constraints from distributed inheritance, folded relationships and weak entities, cardinality bounds, and functional dependencies. Across these workloads, it reports low overhead compared with no enforcement and up to 2.41x better performance than the faster correctness-preserving baseline. The authors also report that LLM-driven writers often violate unenforced constraints and behave erratically when given a list of constraints. The supplied abstract does not detail the proposed broader research challenges.

## Source excerpt

arXiv:2610.36418v1 Announce Type: new Abstract: Integrity constraints have been central to the relational model since its inception. However, beyond keys, single-row CHECKs, and referential integrity, most constraints are enforced by application layers today. SQL ASSERTIONs, standardized in SQL-92, remain poorly supported by major RDBMSs. This has become increasingly unacceptable due to two developments. First, LLM-driven applications and agents increasingly issue queries and updates directly against databases, bypassing application layers where invariants reside. Such code may be generated on demand and discarded afterwards, making the database the only durable component that can encode and enforce these invariants. Second, natural constraints in higher-level conceptual models, such as E/R and property graphs, become fragmented across relations under mappings chosen for performance. The resulting multi-relation constraints lack direct database support, and only some can be efficiently enforced using existing mechanisms such as triggers. These developments motivate an overhaul of how constraints are defined, mined, managed, and enforced in data management systems. As a first concrete step, we introduce constraint indexes, which represent constraints spanning multiple relations as transactional access paths, and implement a proof of concept as a PostgreSQL extension. Constraint indexes enforce constraints arising from distributed inheritance hierarchies, folded relationships, and folded weak entities, as well as cardinality bounds and functional dependencies, at low overhead relative to no enforcement. Across these workloads, they outperform the better of the correctness-preserving baselines by up to 2.41 times. We also show that LLM-driven writers frequently violate unenforced constraints and behave erratically when provided with a list of constraints to enforce. We close by discussing a few research challenges raised by this agenda.