Skip to content

Conversation

@aminch18
Copy link

ExchangeRateUpdater — Architecture & Docker Compose Summary

System Overview

The ExchangeRateUpdater system consists of four main services orchestrated with Docker Compose:

  • Redis: Caching and optional pub/sub.
  • Worker: Runs a bulk backfill on startup, updates daily, and signals readiness by writing a file to a shared Docker volume.
  • API: Serves exchange rate queries, only starts after Worker is healthy, exposes an HTTP health endpoint.
  • ConsoleApp: Initial console application provided in the task.

Key Features & Patterns

  • Clean Architecture with clear separation of concerns.
  • Mediator & Strict CQS patterns for command/query handling.
  • Options Pattern for configuration.
  • Polly for retry policies.
  • OpenAPI docs via Scalar.
  • Healthchecks: Worker (file existence), API (HTTP endpoint).
  • Startup/Dependency Ordering: Compose depends_on with health conditions.
  • Shared Volumes: Used for readiness signaling between Worker and API.
  • Caching: Redis for fast, persistent access.

Startup & Readiness Flow

  1. Redis starts first (persistent volume for data).
  2. Worker starts, performs a parallel bulk backfill, writes results to Redis, and signals readiness by creating /shared/worker_ready.
  3. API starts only after Worker is healthy (readiness file exists), then serves queries from Redis.
  4. Worker continues with daily updates.

Healthchecks & Volumes

  • Worker healthcheck: Existence of /shared/worker_ready.
  • API healthcheck: HTTP GET on /health.
  • Volumes:
    • redis-data for Redis persistence
    • shared for readiness signaling

Best Practices & Production Considerations

  • Use orchestration platforms (Kubernetes, ECS) for advanced features (probes, rollouts).
  • Replace file-based readiness with network-based signaling in distributed setups.
  • Secure Redis, use retries/circuit breakers, and monitor with metrics and alerts.
  • Add integration tests for end-to-end validation.

Diagrams

  • Sequence and component diagrams illustrate startup, readiness, and data flow.

Improvements

  • For distributed/cloud, use network-based readiness (not files).
  • Consider sharding Redis keys and adding integration tests.

In summary:
The system uses Docker Compose to coordinate startup and readiness between services, leverages healthchecks and shared volumes for robust orchestration, and follows modern architectural and design patterns for reliability and maintainability.

aminch18 and others added 9 commits November 27, 2025 18:03
Each project have related folder now.

Task force

Adding simple API

Adding readme

Update Readme.md

Removing unnecessary folder
@wiz-trial-29da161873
Copy link

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 2 High 8 Low
SAST Finding SAST Findings 1 Medium
Total 2 High 1 Medium 8 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants