|
Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 | Tune the Design Proper tuning can be the difference between a successful and unsuccessful implementation. Tuning, in a business rules approach, like all approaches, should be collaborative and iterative. Tuning should be done together by design specialists for data, process, and rules. In some cases, you will want to include representatives from your DBMS vendor and commercial rules product vendor so as to maximize performance of those pieces of software. Some rule vendors claim that their product performs well enough not to need much tuning. This section focuses explicitly on ways to tune the data and rules layer so as to preserve them as shared resources as much as possible. Step 12.10: Tune the Database In this step, you address performance and functionality challenges by tuning the database. Every systems design effort requires database tuning. Tuning the database is, as always, specifying design options that improve performance or functionality of an initial database design. The rule designer and database designer should collaborate here. Guideline 12.10.1 Understand data access characteristics of rules. Classify each rule pattern (or those that are functionality or performance challenges) according to its data access characteristics: single versus multiple tables, single row versus multiple rows, and those requiring aggregate functions and sorts. Perhaps computation rules are the easiest to understand. Computation rules can involve data from a single row in a single table. An example is a column for employee.compensation.amount, which is the sum of the values in two columns in the same row: employee.salary.amount and the employee.commission.amount. A computation rule can involve multiple rows from a single table. An example is the average of employee.salary.amount. Taking it one step further, a computation rule can involve multiple tables such as the sum of the commissions on each sale plus the employee's salary. Let's also consider constraints. The simplest of constraints are those involving a single column. You probably recognize these as simple edit and validation rules. There are also constraints, which involve only one table, but more than one column in that table. Such a constraint may state that the sum of two columns must not exceed a certain value. Another single table constraint may involve aggregate processing of the table, where an average or sum of a column is needed by the rule. Even more complex constraints are constraints requiring multiple tables. A familiar example is referential integrity rules, which are constraints between two tables. Another example is the membership rules among subtypes and supertypes. The same situations may arise for guidelines. Inferred knowledge rules may involve only one table, but usually involve more than one table. Action enablers can also require data from a single or multiple tables. You can see that a rule can require data either from a single row in a single table, multiple rows in a single table, or multiple rows in multiple tables. Some data access requirements for a rule may require a sort, which can be the case for determining maximum, minimum, sum, and average. At this point, review rules for those that may pose performance problems. From a data perspective, these are rules that access multiple tables and require sorts. Review access paths for these rules with the database designer. Please visit the companion Web site for a white paper on relational database design, called Designing Relational Databases. For this chapter, we present a few guidelines for the rule designer to understand. Guideline 12.10.2 Consider first those database tuning options that do not compromise the stable data structure. To preserve the most stable data structure, tune first those tuning options that are transparent and do not compromise the stable data structure. Transparent tuning options are options that are not detectable to business users and to programmers. The goal is to tune these first because they are transparent to people and program code and rules that access the data. In most relational DBMS products, these include, as examples, specifying file allocations, primary and secondary space, free space, locking considerations, and indexes. Guideline 12.10.3 Consider last those database tuning options that compromise the stable data structure. If transparent tuning options prove insufficient, consider tuning options that are not transparent, such as denormalizing the data in a way that makes the denormalization visible to programmers, applications, and people. A nontransparent database tuning option is one that is apparent to the business community, programmer, or rule. That is, tuning a nontransparent option is the altering of the data structure so that it no longer maps to a database representing a rule- enriched logical data model. The most common ways to tune the nontransparent data structure include physically storing columns that are exact copies of other columns, columns whose values are computed according to a formula (a computation rule), or columns whose values are inferred from logic (from an inference rule). You will want to work with the database designer to determine if some of these values should be stored redundantly. Reasons for this may be that performance of certain rules is unacceptable, such as certain complex and data intensive computations. Some rules products have restrictions on how many tables can be referenced in a rule, thus duplicate copies of column values may be needed to reduce the number of tables referenced. Step 12.11: Tune the Rules stock quote | forex trading strategies | earn moneystock investment | money | forex strategy stock market news | stock trading | forex trading courses stock trade | forex exchange | option trading stock option trading | money converter | investing stocks You may need to tune the rule implementation itself. The phrase tune the rules means altering or adding to your preliminary rule design so as to meet functionality or performance requirements that the preliminary design does not meet. You may be surprised to learn that tuning options for rules are similar to tuning options for databases, at least in concept. For example, you can move a rule implementation from the ideal tier to another tier to meet certain requirements. More drastically, you can duplicate rule enforcements across tiers. |