-
Notifications
You must be signed in to change notification settings - Fork 1
Operations.md
This section documents day-two operational procedures for the Banking System, covering migrations, backups, monitoring, and container automation.
Use the provided script to manage schema changes:
BANKING_DATA_PATH="$(pwd)/tmp/data/banking_state.properties" bash deploy/scripts/run-migrations.sh- When
BANKING_JDBC_URLis unset, the script reports the omission and skips JDBC migrations (useful for snapshot-only demos). - With
BANKING_JDBC_URLdefined, SQL migrations execute before application startup. Ensure credentials (BANKING_DB_USER,BANKING_DB_PASSWORD) have the necessary privileges.
-
Snapshot Mode: Copy the
BANKING_DATA_PATHfile to archive account state. Restoring involves replacing the file before launching the application. -
JDBC Mode: Rely on database-native tooling (
mysqldump, point-in-time recovery, or managed service backups). Store dumps securely and test restores regularly. - Resetting the Environment: Drop and recreate the database schema or delete the snapshot file to start with a clean slate.
-
Console Notifications: Real-time feedback for account lifecycle events via
ConsoleNotifier. -
Transaction Logs:
TransactionLoggerrecords operations with timestamps for auditing. -
HTTP Endpoints:
-
/healthz– liveness check -
/metrics– exposure of internal counters (requires authentication) -
/accounts– useful for spot-checking data integrity
-
Integrate these endpoints with your monitoring stack (Prometheus, health probes, etc.) to track uptime and performance.
Two Dockerfiles live under deploy/:
Dockerfile.consoleDockerfile.api
Build images locally:
docker build -f deploy/Dockerfile.console -t banking-console:local .
docker build -f deploy/Dockerfile.api -t banking-api:local .The repository ships a Docker Compose configuration that provisions the console, API, and MySQL:
docker compose -f deploy/compose/docker-compose.yml up --buildThis command mounts persistent state to tmp/data/ and wires environment variables to align with local defaults. Use docker compose ... down to stop the stack.
The GitHub Actions workflow compiles sources, packages runnable JARs, runs migrations, and executes a persistence smoke test. Container build steps are wrapped in a registry availability check to avoid transient Docker Hub outages.
- Rotate database credentials regularly and store them in a secrets manager or CI-provided secret store.
- Enforce HTTPS/TLS termination in front of the API service when deploying to production.
- Review docs/security.md for threat modeling and recommended mitigations.