- Document Version: 2.0.0
- Project Name: SQLDBEntityNotifier
- Target Framework: .NET 6.0
- Document Type: Product Requirements Document for TestSprite Testing
- Created Date: December 2024
- Last Updated: December 2024
- Author: Jatin Dave
- License: MIT
SQLDBEntityNotifier is a production-ready .NET library that provides real-time database change detection across multiple database platforms (SQL Server, MySQL, PostgreSQL) with advanced Change Data Capture (CDC) capabilities. The library enables applications to receive instant notifications when database changes occur, supporting complex filtering, routing, analytics, and recovery scenarios.
- Multi-Database Support: Single API for SQL Server, MySQL, and PostgreSQL
- Advanced CDC Features: Column-level filtering, schema change detection, change correlation
- Enterprise-Grade: Analytics, routing, replay, and recovery capabilities
- Zero Breaking Changes: Full backward compatibility with enhanced features
- Production Ready: Comprehensive testing, error handling, and monitoring
┌─────────────────────────────────────────────────────────────┐
│ Application Layer │
├─────────────────────────────────────────────────────────────┤
│ UnifiedDBNotificationService<T> │
│ + Column Filtering │
├─────────────────────────────────────────────────────────────┤
│ CDCProviderFactory │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │SqlServerCDC │ │ MySqlCDC │ │PostgreSqlCDC│ │
│ │ Provider │ │ Provider │ │ Provider │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ ICDCProvider Interface │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ SQL │ │ MySQL │ │ PostgreSQL │ │
│ │ Server │ │ Binary │ │ WAL │ │
│ │ CDC │ │ Log │ │ Replication│ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
- ChangeAnalytics: Performance metrics and change pattern analysis
- SchemaChangeDetection: Real-time schema change monitoring
- ChangeCorrelationEngine: Multi-table change correlation
- ChangeContextManager: Context propagation and management
- AdvancedChangeFilters: Complex filtering and exclusion rules
- ChangeRoutingEngine: Intelligent change routing and delivery
- ChangeReplayEngine: Change replay and recovery capabilities
- Priority: Critical
- Description: Support Change Data Capture across SQL Server, MySQL, and PostgreSQL
- Acceptance Criteria:
- SQL Server: Native CDC with
sys.sp_cdc_enable_table - MySQL: Binary log monitoring with replication privileges
- PostgreSQL: Logical replication with WAL position tracking
- Unified API interface for all database types
- Automatic provider selection based on connection string
- SQL Server: Native CDC with
- Priority: High
- Description: Monitor specific columns and exclude others from change notifications
- Acceptance Criteria:
- Monitor only specified columns
- Exclude specific columns (e.g., audit fields, timestamps)
- Dynamic column configuration without service restart
- 75-85% reduction in unnecessary notifications
- Support for complex column filter rules
- Priority: Critical
- Description: Detect and notify about database changes in real-time
- Acceptance Criteria:
- Support for Insert, Update, Delete operations
- Schema change detection and notification
- Batch operation support
- Transaction ID tracking
- Old/new value comparison
- Priority: High
- Description: Advanced change analytics, correlation, and context management
- Acceptance Criteria:
- Performance metrics collection
- Change pattern detection
- Multi-table change correlation
- Context propagation across async operations
- Schema change impact analysis
- Priority: Medium
- Description: Intelligent change routing and complex filtering capabilities
- Acceptance Criteria:
- Multi-destination delivery
- Routing rules based on change content
- Advanced filter logic (AND/OR combinations)
- Time-based and content-based filtering
- Destination statistics and monitoring
- Priority: Medium
- Description: Replay changes and recover from failures
- Acceptance Criteria:
- Change replay with configurable options
- Recovery mechanisms for failed operations
- Audit trail maintenance
- Replay session management
- Performance optimization for replay operations
- Description: High-performance change detection with minimal latency
- Acceptance Criteria:
- Change detection latency < 100ms
- Support for 1000+ changes per second
- Memory usage < 500MB for typical workloads
- CPU usage < 20% during peak operations
- Description: Support for large-scale database operations
- Acceptance Criteria:
- Support for 100+ concurrent table monitoring
- Handle 10,000+ columns across all tables
- Support for databases with 1TB+ data
- Horizontal scaling capabilities
- Description: High availability and fault tolerance
- Acceptance Criteria:
- 99.9% uptime availability
- Automatic reconnection on connection loss
- Graceful degradation on partial failures
- Comprehensive error handling and logging
- Description: Secure database connections and data handling
- Acceptance Criteria:
- Encrypted connection strings
- Role-based access control support
- Audit logging for all operations
- Secure credential management
- Description: Easy to maintain and extend
- Acceptance Criteria:
- Comprehensive unit test coverage (>90%)
- Clear separation of concerns
- Dependency injection support
- Extensive documentation and examples
- Coverage Target: >90% code coverage
- Scope: All public methods and critical paths
- Frameworks: xUnit, MSTest, Moq
- Areas:
- CDC provider implementations
- Change detection logic
- Filtering and routing engines
- Analytics and correlation engines
- Error handling and edge cases
- Scope: Database connectivity and CDC operations
- Environments: SQL Server, MySQL, PostgreSQL
- Scenarios:
- Real database change detection
- Cross-database operations
- Performance under load
- Error recovery scenarios
- Metrics: Throughput, latency, resource usage
- Load Testing: High-volume change scenarios
- Stress Testing: Resource exhaustion scenarios
- Benchmarking: Comparison with baseline performance
- Areas: Authentication, authorization, data protection
- Penetration Testing: Vulnerability assessment
- Compliance: Security standard adherence
SQLDBEntityNotifier/
├── Interfaces/ # Core interfaces and contracts
├── Models/ # Data models and DTOs
├── Providers/ # Database-specific CDC providers
├── Helpers/ # Utility classes and extensions
├── Compatibility/ # Backward compatibility layer
├── Examples/ # Usage examples and samples
└── UnifiedDBNotificationService.cs # Main service class
SQLDBEntityNotifier.Tests/ # Main test suite
├── Models/ # Model-specific tests
├── Providers/ # Provider-specific tests
├── Compatibility/ # Compatibility tests
└── Integration/ # Integration tests
SQLEFTableNotification/ # Domain models
SQLEFTableNotificationLib/ # Library implementation
SQLEFTableNotification.Console/ # Console application
SQLEFTableNotificationTests/ # Additional test coverage
- Comprehensive Coverage: Ensure all features are thoroughly tested
- Quality Assurance: Identify and fix bugs, performance issues
- Regression Prevention: Maintain existing functionality
- Documentation Validation: Verify examples and documentation accuracy
- Phase 1: Core functionality testing (CDC, filtering, notifications)
- Phase 2: Advanced features testing (analytics, correlation, routing)
- Phase 3: Performance and stress testing
- Phase 4: Integration and end-to-end testing
- Phase 5: Security and compliance testing
- All 379 existing tests pass
- New test coverage for advanced features
- Performance benchmarks met
- Security vulnerabilities identified and resolved
- Documentation accuracy verified
- ✅ Core CDC infrastructure implemented
- ✅ Advanced change processing engines
- ✅ Advanced routing and filtering
- ✅ Change replay and recovery
- ✅ Comprehensive test suite (379 tests)
- ✅ Advanced features documentation
- 🔄 Machine learning-based change pattern detection
- 🔄 Cloud-native deployment support
- 🔄 Advanced monitoring and alerting
- 🔄 Multi-tenant support
- 🔄 GraphQL API support
- Project Repository: https://github.com/jatinrdave/SQLEFTableNotification
- NuGet Package: https://www.nuget.org/packages/SQLDBEntityNotifier
- Documentation: Comprehensive docs in README files
- Issues: GitHub Issues for bug reports and feature requests
- Product Owner: Jatin Dave
- Technical Lead: Jatin Dave
- QA Lead: TestSprite (AI-Powered Testing)
- Stakeholders: Open Source Community, .NET Developers
This PRD serves as the foundation for comprehensive testing with TestSprite, ensuring all features are thoroughly validated and the library maintains its high quality standards.