Create config.yaml
Couchbase Server
Prerequisites
Couchbase FHIR CE requires a running Couchbase Server instance. You can use:
- Couchbase Server (self-hosted)
- Couchbase Capella (cloud service)
- Local Couchbase instance for development
Configuration
Create a config.yaml file with your Couchbase connection and FHIR server settings:
config.yaml - Complete Template with example values
connection:
## connectionString: "localhost"
## connectionString: "ec2-174-174-64-174.compute-1.amazonaws.com"
## connectionString: "couchbases://cb.abcdxyz.cloud.couchbase.com"
connectionString: "host.docker.internal"
username: "Administrator"
password: "password123"
serverType: "Server"
sslEnabled: false
couchbase:
sdk:
transaction-durability: NONE
max-http-connections: 128
num-kv-connections: 8
query-timeout-seconds: 30
search-timeout-seconds: 30
connect-timeout-seconds: 10
disconnect-timeout-seconds: 10
transaction-timeout-seconds: 30
app:
autoConnect: true
logging:
levels:
com.couchbase.admin: ERROR
com.couchbase.fhir: ERROR
com.couchbase.common: ERROR
com.couchbase.admin.config.service.ConfigurationStartupService: INFO
# To silence a noisy lib:
# org.springframework.web: ERROR
Yaml Indents
When copying and pasting the above config, after pasting, please make sure that the indents are preserved. Yaml files need to be indented properly, otherwise, they will not load.
Configuration Sections Explained
- 🔌 Connection Settings
- ⚙️ Couchbase SDK Settings
- 📱 Application Settings
- 📝 Logging Configuration
Connection Configuration:
connectionString: Couchbase server endpointlocalhost- Local Couchbase installationhost.docker.internal- Docker Desktop for Mac/Windowsec2-xxx.compute-1.amazonaws.com- AWS EC2 instancecouchbases://cb.xxx.cloud.couchbase.com- Capella (SSL)
username/password: Database credentialsserverType: "Server" or "Capella"sslEnabled: SSL/TLS connection (true for Capella)
SDK Performance Tuning:
transaction-durability: NONE (faster) vs MAJORITY (safer)max-http-connections: HTTP connection pool size (128)num-kv-connections: Key-value connection count (8)query-timeout-seconds: N1QL query timeout (30s)search-timeout-seconds: FTS search timeout (30s)connect-timeout-seconds: Initial connection timeout (10s)disconnect-timeout-seconds: Clean disconnect timeout (10s)transaction-timeout-seconds: Transaction timeout
Performance vs Durability
- NONE durability: Faster performance, less data safety
- MAJORITY durability: Slower but ensures data persistence
Application Behavior:
autoConnect: Automatically connect to Couchbase on startuptrue- Connect immediately (recommended)false- Manual connection required
Log Level Control:
ERROR: Show only errors (recommended for production)INFO: Show informational messagesDEBUG: Verbose logging (development only)
Key Loggers:
com.couchbase.admin: Admin UI componentscom.couchbase.fhir: FHIR server operationscom.couchbase.common: Shared utilitiesConfigurationStartupService: Startup information
Custom Logging
Uncomment and modify logging levels as needed. For example, enable Spring Web logging for request debugging.
Environment-Specific Examples
- 🖥️ Local Development
- 🌐 AWS EC2
- ☁️ Couchbase Capella
Local Docker/Server Setup
connection:
connectionString: "host.docker.internal" # Docker Desktop
# connectionString: "localhost" # Local install
username: "Administrator"
password: "password123"
serverType: "Server"
sslEnabled: false
EC2 Couchbase Server
connection:
connectionString: "ec2-12-34-56-78.compute-1.amazonaws.com"
username: "Administrator"
password: "your-secure-password"
serverType: "Server"
sslEnabled: false
Capella Cloud Service
connection:
connectionString: "couchbases://cb.abcd1234.cloud.couchbase.com"
username: "database-user"
password: "capella-password"
serverType: "Capella"
sslEnabled: true