Skip to content

Architecture

Charles d'Avernas edited this page Sep 6, 2024 · 10 revisions

Synapse is built on a resource-oriented architecture, inspired by Kubernetes, to optimize scalability, resilience, and maintainability. Each component is specialized to manage distinct system resources, ensuring efficient operation and seamless integration. This document provides an in-depth overview of Synapse's core components and offers best practices for their effective usage.

API Server

Overview

The API Server is the central hub for managing Synapse resources and provides the HTTP API that facilitates communication with other components and users. It also optionally serves the Dashboard, which is Synapse's graphical user interface (GUI).

Key Functions

  • Resource Management: Handles CRUD operations for Synapse resources such as workflows, correlators, and operators.
  • Dashboard (Optional): Offers a web-based interface for visual interaction with Synapse components.

Best Practices for Usage

  • Secure API Access: Implement and manage authentication and authorization to protect access to the API.
  • Monitor API Performance: Use monitoring tools to track the performance and health of the API server, including response times and error rates.
  • Optimize Dashboard Usage: Regularly review and update the Dashboard to ensure it meets user needs and reflects current system states.

Configuration

Environment Variables

Name Required Description
CONNECTIONSTRINGS__REDIS yes The connection string to the REDIS database to use.
SYNAPSE_API_AUTH_TOKEN_FILE yes The path to the file that defines the static tokens used to authenticate on the API.
SYNAPSE_API_JWT_AUTHORITY yes The API's JWT authority.
Must be the URI used by other Synapse applications to connect to the API.
SYNAPSE_API_CLOUD_EVENTS_ENDPOINT no An absolute URI that references the endpoint the API publishes cloud events to.
If not set, the API won't publish any event.
SYNAPSE_DASHBOARD_SERVE no Configures whether or not the API should serve the Dashboard.
Supported values are: true and false.
Defaults to false.

Operator

Overview

The Operator manages the execution and lifecycle of workflows and workflow instances within Synapse.

Key Functions

  • Workflow Management: Controls the initiation and execution of workflows.
  • Workflow Instance Control: Oversees the lifecycle of workflow instances, including starting, stopping, and monitoring.

Best Practices

  • Ensure Workflow Resilience: Monitor workflow execution and implement strategies to handle failures or retries effectively.
  • Balance Load: Optimize scheduling and resource allocation to prevent bottlenecks and maintain system performance.
  • Regular Monitoring: Continuously monitor the status and performance of workflows to ensure smooth operation.

Configuration

Environment Variables

Name Required Description
CONNECTIONSTRINGS__REDIS yes The connection string to the REDIS database to use.
SYNAPSE_OPERATOR_NAMESPACE yes The operator's namespace.
SYNAPSE_OPERATOR_NAME yes The operator's name.
SYNAPSE_RUNNER_API yes The absolute URI that references the Synapse API used by runners spawned by the operator.
SYNAPSE_RUNNER_LIFECYCLE_EVENTS no Configures whether or not runners spawned by the operator should publish lifecycle events.
Supported values are: true and false.
Defaults to true.
SYNAPSE_RUNNER_CONTAINER_PLATFORM no Configures the platform used by runners spawned by the operator to create and manage containers.
Supported values are: docker and kubernetes.
Defaults to docker.

Correlator

Overview

The Correlator performs Complex Event Processing (CEP) by analyzing and correlating ingested events based on predefined rules.

Key Functions

  • Event Correlation: Detects and processes events to identify patterns and relationships.
  • Pattern Recognition: Recognizes complex patterns within the event stream.

Best Practices

  • Define Effective Rules: Regularly review and update correlation rules to ensure accurate event detection and processing.
  • Monitor Event Streams: Use monitoring tools to track the performance of event processing and identify any anomalies.
  • Optimize Performance: Fine-tune correlation rules and processing settings to handle high volumes of events efficiently.

Configuration

Environment Variables

Name Required Description
CONNECTIONSTRINGS__REDIS yes The connection string to the REDIS database to use.
SYNAPSE_CORRELATOR_NAMESPACE yes The correlator's namespace.
SYNAPSE_CORRELATOR_NAME yes The correlator's name.

Runner

Overview

The Runner executes individual instances of workflows, handling the tasks and transitions defined in the workflow.

Key Functions

  • Task Execution: Processes tasks according to workflow definitions.
  • Instance Isolation: Ensures that each workflow instance operates independently to maintain data integrity.

Best Practices

  • Monitor Task Processing: Keep track of task execution metrics to identify and resolve potential issues.

Configuration

Since runners are spawned by operators, their configuration is indirectly determined by the operators that spawn them.

See operator configuration for more information.

CLI

Overview

The Command Line Interface (CLI) allows users to interact with Synapse's API directly from the command line. It supports a range of operations including resource management and workflow control.

Configuration

The CLI is configured using specific commands.

See configuration commands for more information.

Clone this wiki locally