Architecture Overview
Apify is built on a modular, high-performance architecture designed for scalability and flexibility.
Core Components
Control Plane (CP)
- Manages configuration, APIs, and datasources
- Provides REST API for dynamic updates
- Stores metadata in a dedicated database
- Pushes updates to Data Plane without restarts
Data Plane (DP)
- Handles actual API traffic
- Executes CRUD operations
- Manages database connections
- Enforces authentication and authorization
Request Lifecycle
- HeaderParse: Extract and validate HTTP headers
- BodyParse: Parse and validate request body
- Route: Match request to API operation
- Access: Authentication and authorization
- Data: Execute CRUD operations
- Response: Format and return response
- Log: Request and response logging
Performance
- Multi-threaded: Uses
SO_REUSEPORTfor efficient connection handling - Async I/O: Built on Tokio runtime
- Zero-Copy: Optimized request routing