# jumpmind/symmetric-ds architecture

> Architecture diagram of the GitHub repository jumpmind/symmetric-ds, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jumpmind/symmetric-ds
- Repository: https://github.com/jumpmind/symmetric-ds

## Overview

##### Overview and Components
- Recognize that the source code is divided into multiple modules (or subprojects) such as “symmetric-assemble”, “symmetric-core”, “symmetric-client”, “symmetric-db”, “symmetric-io”, “symmetric-jdbc”, “symmetric-server”, “symmetric-sqlexplorer”, “symmetric-util”, “symmetric-wrapper” (and some others). Each module has a clearly defined responsibility.
- Understand that the replication engine (the heart of the system) is likely contained in modules such as symmetric-core and symmetric-client. The server component (symmetric-server) drives the deployment, configuration, and overall orchestration. There is also a web-enabled user interface (symmetric-sqlexplorer) and various database handling modules (symmetric-db, symmetric-jdbc, etc.) plus utility libraries.

##### Identifying Major Components
- Data Replication Engine: Identify symmetric-core as the main engine that controls replication logic, job definitions, configuration management, error handling, and messaging.
- Client Components: Note the symmetric-client modules (in different languages – native, clib, etc.) that handle replication at the node level.
- Database Abstraction Modules: symmetric-db and symmetric-jdbc provide database agnostic DDL and DML handling, platform-specific implementations, SQL template mechanisms, trigger generation, etc.
- IO and File Synchronization: The symmetric-io module deals with file sync operations, reading/writing batch data, and protocol management.
- Server and Deployment: The symmetric-server module contains the deployment scripts, configuration files, web components, and the main server orchestration (including the REST API endpoints for management).
- Utilities and Extensions: symmetric-util and symmetric-wrapper provide extra utility functions, logging, security (via extensions, such as BouncyCastle integrations), thread management, and application wrappers (for Windows, Unix, Mac service integration).
- Optional Administrative Tools: symmetric-sqlexplorer offers a GUI—built using Vaadin—to work with SQL and database metadata, which can be represented as an external (administrative) subsystem.

##### Relationships and Data Flow
- Connections between the database platform abstraction modules (symmetric-db and symmetric-jdbc) and the core replication engine. These modules support multiple database vendors, providing the replication layer with SQL generation and DDL callbacks.
- Use of extensions and utility functions (symmetric-util) that support logging, error management, and configuration parsing. These are cross-cutting modules that affect almost every other component.
- The “wrapper” module monitors or launches the java application in different environments. That piece acts as an entry/exit point for service management on various platforms and should interact with the server and the underlying replication engine.
- External or administrative users (via a web console or the SQL explorer) interact with symmetric-sqlexplorer and symmetric-server to manage replication nodes and view logs.

##### Architectural Patterns and Design Principles
- Service-Oriented / Modular Architecture: Each module has a specific responsibility and communicates via well-defined interfaces (e.g., Java interfaces in the core and client, extension points in symmetric-util).
- Database and Platform Abstraction: The design makes heavy use of abstractions for different databases (e.g., abstract DDL builders, SQL template factories, etc.).
- Plugin Extension: There are extension points (see the “extensions” packages) that allow customized behavior, such as custom data mapping or integration with external systems.
- Event and Messaging Driven: The core replication engine likely uses event-based mechanisms (e.g., batch event or file sync events) to manage data replication across nodes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Administration & Monitoring"
        server["symmetric-server"]:::admin
        sqlexpl["symmetric-sqlexplorer"]:::admin
    end

    subgraph "Replication Engine"
        core["symmetric-core"]:::replication
        io["symmetric-io"]:::replication
        subgraph "Client Components"
            clientJava["symmetric-client"]:::client
            clientClib["symmetric-client-clib"]:::client
            clientNative["symmetric-client-native"]:::client
        end
    end

    subgraph "Database Abstraction"
        db["symmetric-db"]:::database
        jdbc["symmetric-jdbc"]:::database
    end

    subgraph "Support Modules"
        util["symmetric-util"]:::utility
        wrapper["symmetric-wrapper"]:::utility
        assemble["symmetric-assemble"]:::build
    end

    %% Relationships
    server <-->|"orchestrates"| core
    core -->|"file_sync"| io

    core <-->|"replication"| clientJava
    core <-->|"replication"| clientClib
    core <-->|"replication"| clientNative

    db -->|"SQL_gen"| core
    jdbc -->|"SQL_templates"| core

    server <-->|"admin_interface"| sqlexpl

    util -->|"utilities"| core
    util -->|"utilities"| server

    wrapper -->|"svc_management"| core
    wrapper -->|"svc_management"| server

    assemble -->|"build"| core
    assemble -->|"build"| server

    %% Click Events
    click core "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-core"
    click clientJava "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-client"
    click clientClib "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-client-clib"
    click clientNative "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-client-native"
    click db "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-db"
    click jdbc "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-jdbc"
    click io "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-io"
    click server "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-server"
    click sqlexpl "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-sqlexplorer"
    click util "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-util"
    click wrapper "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-wrapper"
    click assemble "https://github.com/jumpmind/symmetric-ds/tree/3.15/symmetric-assemble"

    %% Styles
    classDef admin fill:#F8C471,stroke:#333,stroke-width:2px;
    classDef replication fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef client fill:#C8E6C9,stroke:#333,stroke-width:2px;
    classDef database fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef utility fill:#D2B4DE,stroke:#333,stroke-width:2px;
    classDef build fill:#F5B7B1,stroke:#333,stroke-width:2px;
```
