Update Rules

Data Abstract uses Update Rules to give your server application detailed control over the order in which updates to different data tables will be applied by the server.

By default, if no update rules are defined, the data abstract service will simply apply all deltas in the order they have been received. This works fine in many scenarios, if the data tables involved are independent. However, if dependencies such as foreign keys or master/detail relationships exist between tables, things become more complicated.

Imagine a typical master/detail scenario with Customers and Orders, where each order is assigned to a particular customer. When a new customer and order pair is added on the client, it is imperative that the customer will be inserted first, before the orders that reference it. Otherwise, inserting of the orders would be rejected by the database, because the foreign key relationship would link them to a non-existing customer.

Conversely, when deleting both a customer and his orders on the client, the reverse logic must be applied, and orders must be deleted before the corresponding customer - otherwise deleting the customer fails because it would again break the foreign key relationship.

Setting up Update Rules

If you feel that you need update rules then Schema Modeler will help you to create, edit or delete them.

See Also