Please enable JavaScript.
Coggle requires JavaScript to display documents.
Configure a Service - Coggle Diagram
Configure a Service
Configuration Sources
(Where configuration values come from)
application.yml
What it is
The default configuration file inside the service.
Packaged together with the application code.
Why it exists
Provides baseline settings required for the service to start.
Acts as the foundation configuration.
Key Insight
This file defines default values.
In real environments, many of these values are overridden.
Typical contents
Default ports
Default feature settings
Basic service configuration
Environment Variables
What it is
Configuration values provided by the operating system.
Why it exists
Keeps sensitive data (like secrets and passwords) outside the code.
Works naturally with Docker, Kubernetes, and cloud platforms.
Key Insight
Environment variables are the most common configuration method in production.
Typical examples
Database credentials
JWT keys
Service discovery URLs
Command-line Properties
What it is
Configuration values passed when starting the service.
Why it exists
Allows quick overrides without modifying configuration files.
Typical use cases
Running services manually
Debugging
Temporary configuration changes
Key Insight
Useful for short-term configuration changes.
External YAML
What it is
A configuration file stored outside the application package.
Why it exists
Separates configuration from code.
Allows different configurations for different environments.
Key Insight
Enables flexible deployment across environments.
Database
(How services store and retrieve data)
Datasource
What it is
Defines how the service connects to a database.
Typical configuration
Database URL
Username
Password
Why it exists
Allows the service to access persistent data.
Key Insight
Without datasource configuration, the service cannot function properly.
Liquibase
What it is
A database schema migration tool.
Why it exists
Automatically updates database tables.
Keeps schema consistent across environments.
Key Insight
Prevents database version mismatch issues.
JPA Dialect
What it is
Specifies database-specific SQL behavior.
Why it exists
Ensures correct SQL generation.
Typical examples
PostgreSQLDialect
MySQLDialect
Key Insight
Required when using ORM frameworks.
YAML Settings
(Detailed service-specific configuration)
Database Config
What it includes
Database connection settings.
Authentication credentials.
Why it exists
Allows fine-grained control of database behavior.
Key Insight
Directly affects reliability and connectivity.
Pool Settings
What it includes
Connection pool size.
Idle connection limits.
Timeout configuration.
Why it exists
Controls resource usage.
Key Insight
Strongly impacts system performance under load.
Feature Toggles
What it is
Configuration flags that enable or disable features.
Why it exists
Allows features to be activated without code changes.
Key Insight
Enables safe feature rollout.
Profiles
(Environment-specific behavior)
Development
Purpose
Used during development.
Typical characteristics
Mock data
Debug logging
Relaxed security settings
Key Insight
Focuses on developer productivity.
Testing
Purpose
Used for automated testing.
Typical characteristics
Test databases
Controlled environment settings
Key Insight
Ensures repeatable test results.
Production
Purpose
Used in live systems.
Typical characteristics
Real databases
Strict security
Performance optimization
Key Insight
Focuses on stability and security.
Service Discovery
(How services locate each other)
Registry Service (Eureka)
What it is
A centralized service registry.
How it works
Service starts.
Registers its address.
Other services query the registry.
Why it exists
Enables dynamic service discovery.
Key Insight
Services can find each other without hardcoded addresses.
Kubernetes Discovery
What it is
Built-in service discovery provided by Kubernetes.
How it works
Kubernetes automatically manages service locations.
Why it exists
Simplifies service discovery in containerized environments.
Key Insight
Kubernetes replaces external service registries.
Security
(How services trust each other)
Internal JWT
What it is
A token used to secure communication between services.
Why it exists
Ensures requests come from trusted services.
Prevents unauthorized access.
Key Insight
Without JWT verification, services cannot safely communicate.
Symmetric (SIG_SECRET_KEY)
What it is
All services share a single secret key.
How it works
The same key is used to:
Sign JWT
Verify JWT
Advantages
Simple to configure.
Suitable for development environments.
Risks
If one service leaks the key, all services become vulnerable.
Key Insight
Requires strict secret management across services.
Asymmetric (Private/Public Key)
What it is
Uses a pair of keys instead of one shared key.
How it works
Private Key signs JWT.
Public Key verifies JWT.
Advantages
More secure than symmetric.
Private key exists in only one place.
Key Insight
This is the standard approach in production systems.
Messaging
(How services communicate asynchronously)
ActiveMQ
What it is
A message broker that supports queue-based communication.
Why it exists
Allows services to communicate asynchronously.
Decouples services from each other.
Key Insight
Messaging improves system scalability and reliability.
Typical usage
Event-driven communication
Background processing