Skip to main content

Architecture Overview

Component Relationships​

Main path: Client → atgateway → atproxy → service → dispatcher → task action → data/DB.

  • atgateway (atframework/service/atgateway): manages client connections, responsible for ECDH/DH key exchange, encryption, compression, rate limiting, and router switching.
  • atproxy (atframework/service/atproxy): cross-service communication proxy, using etcd for service discovery and online detection.
  • Business services (src/*svr/, src/component/*/): uniformly assembled from src/server_frame/; the dispatcher converts messages into coroutine task actions for execution.

Layered View​

LayerLocationResponsibility
Access layeratgateway / atproxyClient access, cross-service forwarding, service discovery
Framework layersrc/server_frame/dispatcher, task, router, rpc, config, data, telemetry
Component layersrc/component/Reusable services + SDKs such as dtmq, distributed_transaction, rank, orbit
Business layersrc/*svr/Reusable login, lobby, cache, friend, matchmaking, and team services
Data layerRedis (db_msg_dispatcher)KV/KL/CAS primitives + DB interfaces generated from *.table.proto
Deployment layerinstall/Helm chart / Docker / bare-metal scripts, rendered by atdtool

Vendored Framework Libraries (atframework/)​

LibraryResponsibility
atframe_utilsBase utilities: logging, algorithms, coroutine wrappers, distributed-system primitives (WAL, etc.)
libatbusInter-server communication bus
libatappServer application framework: module management, event loop, configuration, connectors
service/atproxy / service/atgatewayBuilt-in access services
cmake-toolsetCross-platform CMake toolchain and third-party ports

Single-Threaded Coroutine Model​

Business tasks usually run on the main libuv loop and await results from asynchronous atbus/Redis requests. Dependencies can have background threads; Orbit's client runtime includes a separate thread and cross-thread queues. Follow the selected module's threading and lifetime rules. The PROJECT_SERVER_FRAME_USE_STD_COROUTINE switch toggles between the C++20 coroutine and libcopp cotask implementations, unified behind task_type_traits.h so business code does not need to be aware of the difference.