How jumpmind/symmetric-ds works
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.