Let me provide a comprehensive solution addressing all the optimization areas:
Decision Table Rule Optimization:
Split your 180-rule table into three focused tables: PersonalLoanDecisions (60 rules), BusinessLoanDecisions (70 rules), and MortgageDecisions (50 rules). Create a routing microflow that selects the appropriate decision table based on loan_type attribute. Within each table, reorder rules by frequency - place your most commonly matched scenarios (e.g., standard credit score ranges) at the top. This alone should reduce evaluation time by 40-50%.
Indexed Attribute Usage:
Ensure all frequently queried attributes used in decision conditions have database indexes. Beyond customer_type and credit_score, add indexes to loan_amount, employment_status, and debt_to_income_ratio if you’re using these in conditions. Review your index strategy monthly as your rule patterns evolve.
Splitting Large Tables:
Beyond loan type splitting, consider a two-tier approach: implement a fast-path decision table with 20-25 rules covering your most common scenarios (approximately 70-80% of applications). Only route to detailed decision tables when fast-path evaluation returns “requires_detailed_review”. This dramatically improves average response time.
Performance Monitoring:
Implement custom logging in your routing microflow to track decision table evaluation times. Log the loan_type, decision_table_used, evaluation_time_ms, and rule_matched for each request. Set up alerts when evaluation exceeds 2 seconds. Use Mendix Application Performance Monitor (APM) to identify slow rules and optimize them iteratively.
Microflow Offloading:
Move all calculated attributes and database retrievals out of decision table conditions. Create a PrepareDecisionInput microflow that:
- Retrieves related entity data (customer history, existing loans, credit bureau data)
- Calculates derived values (debt ratios, risk scores, eligibility flags)
- Stores results in temporary attributes on your application entity
- Passes the enriched entity to the decision table
This preprocessing approach ensures decision tables evaluate against pre-calculated values, reducing evaluation time from 4-8 seconds to under 1 second in most cases. For your peak hour performance, consider implementing caching for frequently accessed reference data like interest rate tables and eligibility matrices.
Implement these changes incrementally, starting with the table splitting and microflow preprocessing. Monitor performance after each change to measure impact. You should see immediate improvement from splitting alone, with additional gains from each subsequent optimization.