Maintaining Global Integrity Constraints in Distributed Databases

Given some integrity constraints over a distributed database, we consider the problem of incrementally checking global consistency in response to updates made to the base relations but without accessing all these base relations. In many application areas such as collaborative design, mobile computing and enterprise information systems, total data availability cannot be assumed. Even if all the base data is available, some of it may incur such a high cost that its use should only be considered as a last resort. Without looking at all the relations that participate in the constraint, how can one meaningfully check a constraint for violation? When the constraint is known to be satisfied prior to the update, the state of the relations that are available (aka local) can in principle be used to infer something about the relations that are not available (aka remote). This observation is the basis for the existence of tests that guarantee that global consistency is preserved under a given update, without looking at all the base data. In order to make consistency maintenance practical, the challenge is to find those tests that are most general (we call Complete Local Tests) and that are efficient to generate and execute. This paper addresses the problem of finding efficient complete local tests for an important class of constraints that are very common in practice: constraints expressible as conjunctive queries with negated subgoals. For constraints where the predicates for the remote relations do not occur more than once, we present complete local tests under insertions and deletions to the local relations. These tests can be expressed as safe, nonrecursive Datalog ¬ queries against the local relations. These results also apply to other constraints with negation that are not conjunctive.