Connections
Overview
A Connection is a name given to a data source in Opadeez. Connections allow you to define multiple database sources for your application, enabling entities to store data in different databases as needed. At runtime, the actual connection parameters are defined in the System.properties file.
Connections interface for defining data source configurations
Connection Properties
Connection Name
- Purpose: Unique identifier for the connection
- Usage: This name will appear when linking entities to a connection
- Requirements: Must be unique across all connections in the system
- Best Practice: Use descriptive names that indicate the database purpose (e.g., "MainDB", "ReportingDB", "ArchiveDB")
Connection Type
- Purpose: Define if the connection is SQL or NoSQL
- SQL: Traditional relational databases (MySQL, PostgreSQL, Oracle, SQL Server)
- NoSQL: Document, key-value, or other non-relational databases
- Impact: Determines how Opadeez generates queries and handles data operations
Runtime Configuration
System Properties Integration
Connection parameters are configured at runtime through the System.properties file:
- Database URL: Connection string for the database
- Username/Password: Authentication credentials
- Driver Configuration: Database-specific driver settings
- Connection Pool: Performance and resource management settings
Use Cases
Multi-Database Architecture
- Separation of Concerns: Store different types of data in appropriate databases
- Performance Optimization: Use specialized databases for specific workloads
- Legacy Integration: Connect to existing systems without data migration
- Compliance: Separate sensitive data into secure, compliant databases
Common Connection Scenarios
- Main Application Database: Primary business data storage
- Reporting Database: Read-only replica for analytics and reporting
- Archive Database: Historical data storage for compliance
- External System Integration: Direct access to third-party databases
Best Practices
Connection Design
- Descriptive Names: Use clear names that indicate the database purpose
- Minimal Connections: Only create connections when truly needed
- Security: Store sensitive connection details in System.properties
- Documentation: Document the purpose and usage of each connection
Performance Considerations
- Connection Pooling: Configure appropriate pool sizes in System.properties
- Network Latency: Consider database location and network performance
- Transaction Management: Understand cross-database transaction limitations
- Monitoring: Monitor connection usage and performance
Related Topics
- Entities & Attributes: Learn how to assign connections to entities
- System Properties: Configure runtime connection parameters
- Data Dictionary: Overview of all data definition components
Pro Tip: Start with a single connection for most applications. Add additional connections only when you have specific requirements for data separation or integration with external systems.