Engine Design
Architecture and design patterns of the CaD Engine.
The Engine (also called the CaD Engine - Configuration as Data Engine) is the central orchestration component in Porch that manages the complete lifecycle of package revisions and packages. It acts as the coordination layer between the API server, package cache, repository adapters, and task execution pipeline.
The Engine is responsible for:
The Engine sits between the Porch API Server and the lower-level components:
Key architectural responsibilities:
Abstraction Layer: Provides a clean interface (CaDEngine) that hides the complexity of cache management, repository operations, and task execution from the API server
Workflow Orchestration: Implements the package revision workflow:
State Management: Enforces package lifecycle state machine rules, ensuring packages can only transition through valid states
Integration Point: Connects multiple subsystems:
Validation Gateway: Validates all package operations before execution, including workspace name uniqueness, lifecycle constraints, and task-specific validations
The Engine is instantiated once during Porch API server startup and configured with dependencies (cache, task handler, function runtimes, credential resolvers) through a functional options pattern.
Architecture and design patterns of the CaD Engine.
Overview of CaDEngine functionality and detailed documentation pages.
How the Engine interacts with other Porch components.