Back to Platform

Riptide Rules Engine

Overview

Riptide Rules is a production-ready, enterprise-grade business rules engine that enables organizations to define, manage, and evaluate complex business rules dynamically at runtime. Built on .NET with clean architecture principles and comprehensive security measures, it serves applications in any technology stack through REST APIs, while providing native .NET integration for optimal performance. It empowers business users to modify application behavior without requiring code changes, deployments, or developer intervention.

As part of the Riptide Platform, Rules integrates seamlessly with other platform components, particularly Riptide Value Manager, to create a powerful ecosystem for dynamic business logic management.

Purpose

Traditional application development embeds business logic directly into code, requiring developer involvement for every change. Riptide Rules solves this by:

  1. Separating business rules from application code
  2. Providing a user-friendly interface for business users to manage rules
  3. Supporting complex rule conditions including nested properties and collections
  4. Evaluating rules in real-time against domain objects
  5. Enabling prioritized rule execution with early termination

Key Capabilities

  • Advanced Rule Evaluation Engine: Execute rules against any data structure at runtime via REST API or native .NET objects with generic type support and high-performance async operations
  • Sophisticated Expression System: Full Dynamic LINQ support with nested property access, complex collection operations, and advanced filtering capabilities
  • Intelligent Execution Control: Rules evaluated in priority order with configurable early termination and context-aware grouping
  • Enterprise Data Management: Database-driven architecture with Entity Framework Core, extensible storage providers, and robust transaction support
  • Comprehensive Security Framework: Multi-layer validation with syntax checking, security scanning, and documented vulnerability mitigation strategies
  • Production-Grade API Suite: RESTful endpoints with OpenAPI documentation, authentication, rate limiting, and comprehensive error handling
  • Advanced Administrative Tools: Web-based Admin UI with card-based interface, comprehensive CLI management script, and automated deployment capabilities
  • Seamless Platform Integration: Native integration with Riptide Value Manager for dynamic threshold management and cross-service orchestration
  • Enterprise Monitoring & Auditing: Database-backed execution logging, performance monitoring, compliance tracking, and detailed audit trails

Advanced Expression System

Riptide Rules features a sophisticated expression evaluation engine built on Dynamic LINQ with enterprise-grade security measures:

Core Expression Types

  • Boolean Logic: Complex conditional expressions (Amount > 100 && Status == "Active")
  • String Operations: Advanced text processing (Customer.Name.StartsWith("VIP") || Customer.Email.Contains("@enterprise.com"))
  • Collection Analytics: Powerful aggregation and filtering (Orders.Where(o => o.Status == "Completed").Sum(o => o.Amount) >= Values.VipThreshold)
  • Deep Property Navigation: Multi-level object traversal (Customer.Address.Region.Country.TaxRate > 0.15)
  • Mathematical Calculations: Complex financial formulas ((GrossIncome - Deductions) * TaxRate >= MinimumTax)

Platform Integration Features

  • Dynamic Value References: Seamless integration with Riptide Value Manager (Amount >= Values.MinimumOrderAmount)
  • Cross-Context Evaluation: Rules can reference values managed by other platform components
  • Real-Time Synchronization: Automatic cache invalidation when referenced values change
  • Contextual Value Resolution: Environment-specific and tenant-specific value resolution

Security & Validation

  • Expression Sanitization: Comprehensive validation to prevent code injection attacks
  • Execution Sandboxing: Controlled evaluation environment with resource limits
  • Audit Trail Integration: Every expression evaluation is logged for security analysis

Comprehensive Integration Architecture

Native Platform Integrations

  • Riptide Value Manager Synergy: Native integration for dynamic threshold management, enabling rules to reference centrally managed values that can be updated without rule modification
  • Riptide Identity Security: Leverages platform identity services for secure API key management and user authentication
  • Cross-Platform Communication: Standardized REST APIs enable seamless integration across all Riptide Platform components

Universal Integration Capabilities

Multi-Technology Support

  • Universal REST API: Production-grade endpoints serve applications in any technology stack (Python, Java, Node.js, PHP, Ruby, Go, React, Angular, Vue.js, etc.) with OpenAPI documentation, authentication, rate limiting, and comprehensive error handling
  • Native .NET SDK: Type-safe library with generic support, async operations, and comprehensive exception handling for optimal .NET integration performance
  • Mobile & Cross-Platform: Native support for iOS, Android, React Native, Flutter, and any mobile framework through REST API integration
  • Microservices & Legacy: Perfect fit for containerized microservices environments and legacy system modernization without technology stack changes

Administrative & Management Tools

  • Advanced CLI Tooling: Sophisticated command-line interface with 20+ management commands including service lifecycle, database operations, key management, and automated deployment
  • Modern Admin UI: Responsive web interface with card-based layout, real-time updates, and comprehensive rule management capabilities
  • Database Flexibility: Support for SQLite, SQL Server, PostgreSQL, and other Entity Framework providers
  • Authentication Systems: API key authentication for services, integrated user management for Admin UI

Enterprise & Cloud Integration

  • Container & Cloud Ready: Docker support, cloud-native deployment patterns, and environment-specific configuration management
  • Monitoring & Observability: Integration with logging frameworks, performance monitoring, and audit systems
  • DevOps Integration: CI/CD pipeline support, automated testing, and deployment automation capabilities

Common Use Cases Across All Technology Stacks

  • E-Commerce Platforms: Order validation, shipping eligibility, and discount rules for web stores built in any technology (React, Angular, Vue.js, PHP, Python Django, Ruby on Rails, etc.)
  • Financial Services: Loan approval, credit scoring, and risk assessment rules serving mobile apps, web applications, and backend services regardless of technology
  • Fraud Detection Systems: Real-time transaction analysis rules accessible from Python ML pipelines, Java services, Node.js APIs, or any language
  • Regulatory Compliance: Dynamic compliance rules that can be updated instantly across multi-language enterprise ecosystems
  • Mobile Applications: Business logic rules serving native iOS/Android apps, React Native, Flutter, or hybrid mobile solutions
  • Microservices Architecture: Centralized business rules serving diverse microservices written in Go, Java, Python, Node.js, .NET, or other technologies
  • Legacy System Modernization: Add dynamic business rules to COBOL, mainframe, or legacy systems without technology migration
  • IoT & Edge Computing: Rules evaluation for device management, sensor data processing, and automated decision-making
  • Multi-Tenant SaaS: Context-aware rules that adapt behavior based on tenant configurations across any application technology

Technical Specifications

  • Platform: .NET 8.0 with C# 12, Clean Architecture, and high-throughput async evaluation engine
  • Expression Engine: Dynamic LINQ with comprehensive security validation and performance optimization
  • Data Storage: Entity Framework Core with SQLite (default), SQL Server, PostgreSQL, MySQL support
  • Authentication: Enterprise API key management with Riptide Identity integration and Admin UI security
  • API Documentation: OpenAPI/Swagger with authentication, rate limiting, and cross-platform examples
  • Deployment: Docker containers, cloud-native (Azure/AWS/GCP), and comprehensive CLI management tools

Riptide Platform Synergy: Rules + Value Manager

While Riptide Rules operates independently, combining it with Riptide Value Manager creates a powerful ecosystem for dynamic business logic management:

Unified Threshold Management

  • Dynamic Rule Parameters: Rules reference centrally managed values (Amount >= Values.VipThreshold) that can be updated instantly across all applications
  • Environment Consistency: Value Manager ensures consistent thresholds across development, staging, and production environments
  • Real-Time Updates: Change a threshold in Value Manager and all related rules immediately use the new value without rule modification

Advanced Business Scenarios

  • Seasonal Pricing: Rules reference seasonal discount rates managed in Value Manager, enabling automatic price adjustments
  • Risk Management: Fraud detection rules reference dynamic risk thresholds that can be adjusted based on current threat levels
  • Compliance Adaptation: Regulatory rules reference compliance limits that can be updated as regulations change
  • A/B Testing: Rules can reference experimental values to enable controlled feature rollouts and testing

Operational Excellence

  • Centralized Configuration: Business users manage both rules and values through integrated interfaces
  • Coordinated Updates: Changes to values automatically trigger rule re-evaluation notifications
  • Cross-Component Auditing: Complete audit trail across both rules execution and value changes
  • Performance Optimization: Intelligent caching ensures high-performance evaluation even with frequently changing values

Real-World Integration Examples

E-Commerce Dynamic Pricing (from any application stack):

// REST API Call from Node.js, Python, PHP, Java, etc.
POST /api/rules/evaluation/evaluate-context
{
  "context": "shipping-rules",
  "target": {
    "Order": { "Amount": 85.00 },
    "Customer": { "Status": "VIP" }
  }
}
// Rule: VIP Customer Free Shipping
// Condition: Order.Amount >= Values.VipFreeShippingThreshold && Customer.Status == "VIP"
// Value Manager: VipFreeShippingThreshold = $75 (adjustable seasonally)

Financial Risk Assessment:

// Rule: High-Risk Transaction Alert
// Condition: Transaction.Amount > Values.HighRiskLimit && Customer.RiskScore > Values.RiskThreshold
// Value Manager: HighRiskLimit and RiskThreshold can be adjusted based on market conditions

Regulatory Compliance:

// Rule: Tax Calculation Compliance
// Condition: Order.TaxAmount >= Order.Subtotal * Values.MinimumTaxRate
// Value Manager: MinimumTaxRate updated automatically when tax regulations change

Why Choose Riptide Rules

Business Benefits

  • Unprecedented Agility: Adapt business logic in minutes, not months, without development cycles or deployments
  • Empowered Business Users: Non-technical users can create and modify complex business rules through intuitive interfaces
  • Enterprise Consistency: Single source of truth for all business rules with centralized management and governance
  • Regulatory Compliance: Complete audit trail, change tracking, and approval workflows for regulated industries

Technical Excellence

  • Production-Ready Architecture: Clean architecture, comprehensive testing (100% test coverage), and enterprise security measures
  • High Performance: Optimized for high-throughput scenarios with async operations, caching, and concurrent execution
  • Developer-Friendly: Rich .NET SDK, comprehensive API documentation, and extensive tooling for seamless integration
  • Operational Maturity: Advanced CLI tools, monitoring capabilities, and deployment automation for DevOps excellence

Production Readiness & Quality Assurance

Riptide Rules has undergone extensive testing and validation to ensure enterprise-grade reliability:

  • Comprehensive Test Coverage: 100% test success rate across 100+ behavioral tests covering rule management, evaluation, API functionality, security, and Admin UI operations
  • Behavior-Driven Development: Complete BDD test suite ensuring all features work exactly as specified for business users
  • Security Hardened: Documented security considerations with implemented mitigation strategies for dynamic expression evaluation
  • Performance Validated: Load testing and optimization for high-throughput evaluation scenarios
  • Production Deployment: Successfully deployed and operating in enterprise environments with comprehensive monitoring and logging