sandbox/ivideon/puml/geo/architechture.puml
2026-02-13 17:36:23 +03:00

101 lines
3 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@startuml geo_architecture
skinparam componentStyle rectangle
skinparam backgroundColor white
title Архитектура сервиса Geo (Geobalancing Server)
package "Geo Service" {
package "geo-backend" as backend {
component [handlers.py\nHTTP обработчики] as handlers
component [balancing.py\nЛогика балансировки] as balancing
component [stream_request.py\nОбработка стримов] as stream
component [auth.py\nАвторизация] as auth
component [billing.py\nБиллинг] as billing
}
package "geo-api" as api {
component [REST API\nУправление серверами] as rest_api
component [Управление группами] as groups_api
component [Управление локациями] as locations_api
}
package "geo-resolver" as resolver {
component [IP Resolver\nГеолокация по IP] as ip_resolver
component [Geo Providers\n(IP-API, MaxMind)] as geo_providers
component [Resolver Cache] as resolver_cache
}
package "geo-web" as web {
component [Web Interface\nАдмин панель] as web_ui
}
package "Общие компоненты" {
component [ip_location.py\nIPLocation] as ip_location
component [api_client.py\nGeoApiClient] as api_client
component [errors.py] as errors
}
}
package "Хранилище данных" {
database "MongoDB" as mongo
frame "Кэши" {
component [place_cache] as place_cache
component [group_cache] as group_cache
component [dns_cache] as dns_cache
}
}
' Связи
handlers --> balancing
handlers --> stream
handlers --> auth
handlers --> billing
balancing --> ip_resolver
balancing --> group_cache
balancing --> place_cache
stream --> auth
ip_resolver --> geo_providers
ip_resolver --> resolver_cache
web_ui --> api_client
api_client ..> rest_api : HTTP
rest_api --> mongo
backend --> mongo
backend --> place_cache
backend --> group_cache
handlers ..> ip_location
balancing ..> ip_location
note right of backend
**Основные задачи:**
• Обработка запросов на балансировку
• Выбор оптимального сервера
• Редиректы на ноды
• Авторизация и биллинг
end note
note right of resolver
**Выделен отдельно из-за**
**большого потребления памяти**
Позволяет запускать geo-backend
в несколько процессов
end note
note right of mongo
**Хранит:**
• Серверы (nodes)
• Группы серверов
• Географические локации
• Привязки локаций к группам
• Резервации
• Настройки хранилищ
end note
@enduml