C4 architecture model
C4 model is used to visualize system architecture and explain the decomposition of the system into elements. Diagrams in this model are organized by the principle of increasing detail - from the system context to its components. Component diagrams (C3) are used to describe the architecture of each service.
Tip
To explore a diagram in details, right-click the required image and select Open image in a new tab or Save image as.
General architecture
Component diagrams
Component diagrams detail the internal structure of each container. A component is a logical module within a service that implements a specific task. Components interact with each other within a container and can also access components of other containers to perform tasks.
Below are separate component diagrams for each container.
DGCLI utility
The DGCLI utility downloads license and update artifacts from 2GIS servers, saves them to an S3-compatible storage or file system, and restores them for service installation.
For more information on the utility structure, see the DGCLI architecture section.
License service
The License service provides access the 2GIS software suite services. The DGCLI utility requests a license from 2GIS servers and writes it to an S3-compatible storage or file system. On-Premise software suite products access the License service to verify the license presence, its validity period, and permission to use specific services.
For more information on the License service structure:
API Keys service
The API Keys service consists of an administrator web service for managing API keys and a backend service for interacting with other services via RESTful API. Suite services send request metadata to the Keys service, which reads events from storage and maintains key usage counters.
For more information on the API Keys service structure:
Statistics Collection service
Statistics Collection service consists of two components:
- Stat Receiver - receives API key usage data from map, search, and navigation services and sends it to the message broker, from where it is loaded into the analytical DBMS.
- Stat API - reads data from the analytical DBMS and displays it on the Statistics tab in the Platform Manager.
For more information on the structure of the Statistics Collection service:
Maps API
Maps API consists of interacting components for displaying tiles in web and mobile applications. Tiles API provides vector, mobile, and raster tiles from storage. Styles API allows loading custom styles for vector maps. Traffic API Proxy retrieves traffic data from 2GIS servers, which is then displayed on the map. Access to all components is controlled through the License and API Keys services, while the Statistics Collection service tracks API key usage.
For more information on the maps API structure:
Traffic API Proxy
Traffic API Proxy receives traffic data from 2GIS servers. End applications and navigation services then request this data to display traffic on the map.
Styles API
Styles API is a service for uploading, storing, and providing map styles. Platform Manager initiates the upload of a custom style and sends the request to Styles API. Maps API and Mobile SDK request style data from Styles API and use it to display maps in web and mobile applications.
Search API
Search API consists of Catalog APIs, which provide RESTful APIs for end users, and Search API - a search engine for processing requests. Catalog APIs access Search API to perform searches. The services interact with the License, API Keys, and Statistics Collection services for access control.
For more information on the search API structure:
Navigation API
Navigation API uses a scalable architecture with role separation between components: Navi-Front receives requests, Navi-Router verifies access and routes requests, Navi-Back processes requests based on data from Navi-Castle. The regions and rules system allows distributing load among multiple Navi-Back instances, each processing its portion of regions. Navi-Attractor snaps points to the road graph, and Restrictions API provides information about road restrictions.
For more information on the navigation API structure:
Processing asynchronous requests
Distance Matrix Async API is designed for calculating distance matrices for a large number of points in asynchronous mode. The service interacts with Navi-Back through an S3-compatible storage and a broker, using data from Navi-Castle to determine the appropriate instance for processing the request. Request execution status information is stored in a DBMS, and users receive results through periodic status queries.
For more information on the navigation API structure with Distance Matrix Async API, see the Processing asynchronous requests to Distance Matrix API section.
Solving the traveling salesman problem
To solve the traveling salesman problem, the TSP API service is used, which consists of two components: VRP Task Manager and VRP Solver. The service receives a list of points, optimizes the order of traversal, and returns the optimal route considering distances and travel time. It interacts with the main navigation services to calculate distance matrices and build the final route.
For more information on the navigation API structure with TSP API, see the Solving the traveling salesman problem section.
2GIS Pro
2GIS Pro consists of Pro UI and Pro Backend components (Pro API and assetImporter). Pro API interacts with Elasticsearch for filtering, aggregation, and geosearch, with a DBMS for storing metadata and user projects, and with an S3-compatible storage for accessing prepared datasets. Users can work with built-in datasets or upload their own data manually or via API.
For more information on the 2GIS Pro structure:
2GIS CityLens
2GIS CityLens consists of a driver mobile application, an API for data transmission, a route planning service, and a web interface for working with tasks. CityLens Routes worker processes events from the broker, analyzes task traversals, and sends results to related services. Frame data is stored in an S3-compatible storage, task information is stored in a DBMS, and components interact through a broker.
For more information on the CityLens structure:
Mobile SDK
Mobile SDK receives mobile tiles through Tiles API for map display, uses RESTful APIs from search services to implement a search engine, and navigation APIs to build routes. The Traffic API Proxy provides real-time traffic data from 2GIS public servers.
For more information on the mobile SDK structure:
Platform Manager
Platform Manager provides an interface for checking service status, uploading map styles, managing user access, and locally testing key APIs.
An external OIDC provider is used for user authentication. To test services on the Playgrounds page, Platform Manager sends requests to MapGL JS API, search, and navigation services using API keys. Platform Manager also interacts with Styles API to import and store custom map styles.
For more information on the Platform Manager structure: