How tikv/pd works
Main Components Identification
The system should be divided into these major components:
a. Core Services:
• TSO (Timestamp Oracle) Service
• Scheduling Service
• Resource Manager Service
• Meta Storage Service
• Key Space Management Service
b. Infrastructure Layer:
• Embedded etcd for persistence and fault tolerance
• gRPC/HTTP API servers
• Client SDK
Key Architectural Elements
a. Server Components:
• API Layer (server/api/*)
• Cluster Management (server/cluster/*)
• Configuration Management (server/config/*)
• Storage Layer (pkg/storage/*)
b. Client Components:
• Client SDK (client/*)
• HTTP Client (client/http/*)
• Various Service Clients (client/clients/*)
External Interface Layer
• HTTP/gRPC APIs
• Client SDKs
• Dashboard UI
Core Services Layer
• TSO Service (Timestamp Oracle)
• Scheduling Service
• Resource Management
• Meta Storage
• Key Space Management
Internal Components Layer
• Cluster Management
• Store Management
• Region Management
• Statistics Collection
Storage Layer
• Embedded etcd
• Local Storage
Connection Flows
• Client request flows
• Internal service communication
• Data persistence paths
• Scheduling decision flows
Detailed Component Relationships
Interactions between:
• TSO service and clients
• Scheduler and TiKV nodes
• Resource manager and consumers
• Meta storage and other services
Metrics and Monitoring
Highlight:
• Prometheus metrics endpoints
• Grafana dashboard connections
• Alert manager integration