Why Use Isok?
Prev |  | Next

## Why Use Isok?

Simplicity is one appealing property. Writing a query to find data problems is simple. Give the query to Isok and use it to manage your problem resolution process.

Do you ...

- Import data into PostgreSQL to be cleaned up later?

- Clean up database content over time?

- Allow or dis-allow specific data patterns on a case-by-case basis?

- Monitor data for changes, or for unusual but not dis-allowed conditions?

- Not want to write data validation apps or find triggers unsuitable, or too much work?

Isok may be for you if you are involved in data cleanup, or data integrity maintenance, or don't want to put your data monitoring into an app or otherwise design something, or are tired of re-examining the "problems" your queries report that you have determined are not really problems.

Isok can help you manage your data's integrity, especially when little technical effort can be spared or manual review is involved.

- If you can write a query to find problematic, but sometimes allowed, data, Isok will show you only those problem cases that you have not accepted as valid. You don't have to repeatedly re-review query output.

- If you want to manage your data cleanup over time, Isok can help ensure that newly added data is "cleaned", while scheduling the cleanup of old issues.

- If you can write a query to find problems in your data, don't want to engineer anything more, and want a system to track and manage the problems discovered.

Discover, track, and manage problematic data patterns. Manage issue resolution, which may involve accepting questionable data, unchanged. Report not only the existence of particular data patterns, but also report changes to values of previously accepted data. Isok is especially suited when importing “dirty” data into PostgreSQL for cleanup and analysis, and for corner cases where business logic is “fuzzy”.

There can be a use-case to monitor for, and manage, outright errors in data, when you don't want to use triggers or, especially, constraints, for this purpose.[2] Isok can create, in effect, what may be thought of as a “soft trigger”. One that is as simple to make as it is to write a query.

### The One-to-One-Or-More Problem Almost Everyone Has

Most database schema designs will have at least one inter-table relationship that is One-to-One-Or-More. An example might be a CUSTOMERS table and an ORDERS, table where a customer may have multiple orders but is expected to have at least one.

The problem is that the ORDERS table typically has a CustomerID column, which contains a foreign key that references a CUSTOMERS row, and this is enforced with a foreign key constraint. The constraint requires a CUSTOMERS row to exist, before an ORDERS row can reference it. So the CUSTOMERS row is created first, and then rows are added to ORDERS.

But this opens up the possibility for a a customer to exist without having any related orders. Now, this may or may not be desirable.[3] Or, there may even be time limits on how long such a condition should be allowed to exist. After a certain amount of time, you may want to remove from the database a customer that has never ordered anything. Regardless, Isok provides a simple way to manage the situation.

Isok can be given a query like:

SELECT customers.id
, 'Customer ' || customers.id || ' has no related ORDERS'
, NULL
FROM customers
WHERE NOT EXISTS (SELECT 1
FROM orders
WHERE orders.customerid = customers.id);

With this query, Isok's features help manage customers that have no related orders.

[2] Triggers and constraints are the usual data validation methods, because these prevent erroneous data from getting into the database in the first place. But you may need all data, “valid” or not, to be in your database, or you may have other reasons why triggers or constraints are not an appropriate approach.

[3] Should you never want customers without orders, you can mark your referential constraint as `INITIALLY DEFERRED`, or, in older PostgreSQLs, create an initially deferred constraint trigger.

The application that creates customers and orders must then put the creation of a customer, with an initial order, into a transaction.

Prev |  | Next
A Very Short Introduction | Home | How Isok Works

Page generated: 2025-12-15T15:11:23-06:00.