Connections
Connection Features
A connection is a configuration containing information necessary to access an external system. Connections are defined once and can be used by multiple API Proxies or tasks.
A connection can be used by multiple API Proxies or tasks
Connections are managed and updated centrally
Connection information is stored encrypted
Connections can be tested and validated
Connection Usage Flow
The following diagram shows how connections are used by API Proxies and policies:
sequenceDiagram
participant Client as 👤 Client
participant Gateway as 🚪 API Gateway
participant Proxy as 🔀 API Proxy
participant Policy as 🛡️ Policy/DB-2-API
participant Connection as 🔌 Connection
participant ExternalSystem as 🖥️ External System<br/>(DB, Kafka, Email, etc.)
Client->>Gateway: HTTP Request
Note over Gateway: Request Reached Gateway
Gateway->>Proxy: Route Request to API Proxy
Note over Proxy: API Proxy Processing
Proxy->>Policy: Policy or DB-2-API<br/>Executed
Note over Policy: External System Access Required
Policy->>Connection: Connection Usage<br/>(Centralized Configuration)
Note over Connection: Connection Information<br/>(Encrypted)<br/>Host, Port, Credentials
Connection->>ExternalSystem: Secure Connection<br/>Established (SSL/TLS)
Note over ExternalSystem: External System Types:<br/>Database (MongoDB, MySQL, etc.)<br/>Message Queue (Kafka, RabbitMQ)<br/>Email (SMTP)<br/>Search (Elasticsearch)
ExternalSystem->>Connection: Operation Result<br/>Returns
Connection->>Policy: Connection Result
Policy->>Proxy: Policy Processing Completed
Proxy->>Gateway: Processed Response
Gateway->>Client: HTTP Response
Note over Client,Gateway: Process Completed
Note over Connection,ExternalSystem: Connection Pool<br/>Management and<br/>Reuse
Connection Types
The Apinizer platform provides support for connections to a wide variety of external systems:
Database Connections
MongoDB NoSQL database connections
MySQL database connections
PostgreSQL database connections
Oracle database connections
Microsoft SQL Server connections
IBM DB2 connections
Sybase database connections
Apache Hive database connections
Apache Impala database connections
Trino (PrestoSQL) database connections
Message Queue Connections
Apache Kafka connections
RabbitMQ connections
Apache ActiveMQ connections
Search and Data Connections
Elasticsearch cluster connections
LDAP/Active Directory connections
HTTP webhook connections
Communication Connections
Email server connections
FTP/SFTP server connections
Linux script execution connections
Logging and Monitoring Connections
Graylog GELF connections
Syslog connections
Logback logging connections
SNMP connections
Connection Configuration
When creating a connection, the following information is defined:
Basic Information
- Connection Name: Unique name identifying the connection
- Connection Type: Database, message queue, etc.
- Description: Descriptive information about the connection (optional)
Connection Information
- Host/URL: Server address or connection URL
- Port: Connection port (varies by connection type)
- Database Name: Database name (for database connections)
Authentication
- Username: Username for the connection
- Password: Password for the connection (stored encrypted)
- Credential Usage: Whether credentials will be used
Advanced Settings
- Connection Pool: Connection pool settings (min/max pool size, etc.)
- Timeout: Connection timeout settings
- SSL/TLS: Secure connection settings
- Deploy to Worker: Whether to deploy to Worker
- Enabled: Whether the connection is active
Connection Usage
Connections are used in the following situations:
DB-2-API can perform database queries
SQL queries can be executed using database connections and results can be returned as API responses.
Access to external systems is provided in Task Flows
Connections are used in Task Flows for operations such as database queries, message queue operations, and email sending.
Used for connectors to connect to external systems
Connectors use connections to access different systems and exchange data.
Can be used for access to external systems within policies
Some policies can communicate with external systems using connections.
Connection Security
Important Security Notes:
- Connection information (username, password) is stored encrypted
- Secure connections (SSL/TLS) must be used in production environments
- Connection information is never written to log files
- Connection information should be updated regularly
Since connections are managed centrally, when a connection's information changes, all API Proxies and tasks using this connection automatically use the updated information.
Connection Management
After connections are created:
- Testable: Connections can be tested and validated
- Updatable: Connection information can be updated
- Deletable: Connections that are no longer used can be deleted
- Environment-Based: Connections can be assigned to specific environments
When creating connections, optimize connection pool settings according to your system load. Use low pool size for small systems and high pool size for high-traffic systems.