# kkarakamis/elevation-data-query-with-microservices architecture

> Architecture diagram of the GitHub repository kkarakamis/elevation-data-query-with-microservices, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kkarakamis/elevation-data-query-with-microservices
- Repository: https://github.com/kkarakamis/elevation-data-query-with-microservices

## Overview

##### Main Components Identification

a) Database Service (dtedelevationdb)
- Handles data ingestion and storage
- Contains entities for Border and Grid
- Manages database operations

b) Eureka Server (eurekaserver)
- Service registry and discovery
- Central hub for microservices communication

c) Router Service (elevation-server-router)
- Implements load balancing
- Routes requests between services

d) Elevation Service (elevationservice)
- REST API implementation
- Business logic for elevation queries
- Contains controllers, services, and repositories

e) Client Application (getelevation)
- Consumer application
- Sends queries and processes JSON responses

**[Client Application] --> [Router Service (Load Balancer)]**

**[Eureka Server (Service Registry)]**

**[Elevation Service Instance 1] [Elevation Service Instance 2] ... [Elevation Service Instance N]**

**[Database Service] <--> [Database]**

##### Specific Details

a) Service Registration:
- Registration/heartbeat mechanism

b) Load Balancing:
- How router distributes requests across multiple service instances
- Load balancing algorithm indicator

c) Data Flow:

##### Additional Elements

- Service instance scaling capability
- Important properties and configurations

##### Technical Details to Note

Annotations for:
- REST endpoints
- Entity relationships
- Spring Boot components
- Service discovery mechanisms
- Load balancing strategy

##### Infrastructure Notes

- Spring Boot framework usage
- Maven dependency management
- Application properties configuration
- Service ports and communication protocols

Keep the abstraction level high enough to understand the overall architecture but detailed enough to show the microservices interaction patterns and data flow through the system.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Layer"]
        C1["Client Application"]:::client
    end

    subgraph Router["Routing Layer"]
        LB["Router Service\n(Load Balancer)"]:::router
    end

    subgraph Discovery["Service Discovery Layer"]
        ES["Eureka Server"]:::discovery
    end

    subgraph Services["Service Layer"]
        direction TB
        ES1["Elevation Service\nInstance 1"]:::service
        ES2["Elevation Service\nInstance 2"]:::service
        ES3["Elevation Service\nInstance N"]:::service
    end

    subgraph Data["Data Layer"]
        direction TB
        DBS["Database Service"]:::database
        DB[(Elevation\nDatabase)]:::database
    end

    C1 --> LB
    LB --> ES1
    LB --> ES2
    LB --> ES3

    ES1 -.-> ES
    ES2 -.-> ES
    ES3 -.-> ES
    LB -.-> ES
    DBS -.-> ES

    ES1 --> DBS
    ES2 --> DBS
    ES3 --> DBS
    DBS <--> DB

    %% Click events for component mapping
    click C1 "https://github.com/kkarakamis/Elevation-Data-Query-with-Microservices/tree/master/getelevation(client)/src/main/java"
    click LB "https://github.com/kkarakamis/Elevation-Data-Query-with-Microservices/blob/master/elevation-server-router/src/main/java/tr/kkarakamis/elevationserverrouter/ElevationServerRouterApplication.java"
    click ES "https://github.com/kkarakamis/Elevation-Data-Query-with-Microservices/blob/master/eurekaserver/src/main/java/tr/kkarakamis/eurekaserver/EurekaserverApplication.java"
    click ES1 "https://github.com/kkarakamis/Elevation-Data-Query-with-Microservices/tree/master/elevationservice/src/main/java/tr/kkarakamis/elevationservice"
    click DBS "https://github.com/kkarakamis/Elevation-Data-Query-with-Microservices/tree/master/dtedelevationdb/src/main/java/tr/kkarakamis/dtedelevationdb"

    %% Styling
    classDef client fill:#2196F3,stroke:#1565C0,color:white
    classDef router fill:#4CAF50,stroke:#2E7D32,color:white
    classDef discovery fill:#4CAF50,stroke:#2E7D32,color:white
    classDef service fill:#FFC107,stroke:#FFA000,color:black
    classDef database fill:#9E9E9E,stroke:#616161,color:white

    %% Legend
    subgraph Legend
        direction TB
        L1["Client Component"]:::client
        L2["Routing/Discovery Component"]:::router
        L3["Service Instance"]:::service
        L4["Database Component"]:::database
        L5[" "] -..-> L6[" "]
        L7["Service Registration"]
        L8[" "] --> L9[" "]
        L10["Request Flow"]
    end
```
