Copyright © 2007-2015 JumpMind, Inc

Version 3.7.38

Permission to use, copy, modify, and distribute this SymmetricDS Tutorials Guide for any purpose and without fee is hereby granted in perpetuity, provided that the above copyright notice and this paragraph appear in all copies.

1. Quick Start

To see a demonstration of a preconfigured SymmetricDS environment see the Demo tutorial.

This guide will walk you through the minimum steps required to setup data synchronization through a single installation of SymmetricDS.

Steps covered
  1. Install

  2. Run

  3. Connect Source Database

  4. Select Tables

  5. Connect Target Database

1.1. Install

Download and install SymmetricDS from the JumpMind website.

For complete installation instructions click here

1.2. Run

Open the control center to verify SymmetricDS server is running. If it is not start the server using the start server button. Then open the web console using the open web console button.

control center
Figure 1. SymmetricDS Control Center
Depending on your operating system a program shortcut for the control center might have been setup. Otherwise you can find it directly in the /bin directory of your SymmetricDS installation. The executable file is named symcc.

1.3. Connect Source Database

wizard node setup
  1. Select "Master Node" from the node setup wizard

  2. Provide JDBC connection information for your source database, hit next

  3. Select "Standard 2 Tier" profile, hit next

  4. Use the default sync url, hit next

  5. Provide a password for the web console, hit next

  6. Finish

For complete instructions creating the master node click here

1.4. Select Tables

The Quick Config wizard will be displayed by default when configuration is missing. If it is closed or not visible it can be opened by hitting the "Quick Config" button on the Overview screen of the Configure tab.

wizard config start
wizard config client server
  1. Welcome, hit next

  2. Select tables you wish to sync from client to server, hit next

  3. Select tables you wish to sync from server to client, hit next

  4. Verify the summary, hit finish

For complete instructions for the quick config wizard click here

1.5. Connect Target Database

The Add Node wizard will be displayed by default when only one node has been configured. If it is closed or not visible it can be opened by hitting the "Add" button on the Nodes screen of the Manage tab.

wizard connect menu
  1. Select Local Node, hit next

  2. Provide JDBC connection information for your target database, hit next

  3. Select default registration url, hit next

  4. Select client node group, hit next

  5. Provide an external id of 1, hit next

  6. Select default sync url, hit next

  7. Choose appropriate options here depending if your target tables already exist and if they should be initially loaded with data from the source. Hit next

  8. Hit finish

For complete instructions to setup the target database click here

Congratulations! You have completed the Quick Start.

2. Demo

This guide explains how to quickly setup a demonstration of SymmetricDS to help you understand what a working system looks like.

Three nodes, which represent three embedded databases, will be installed. One node will represent a centralized corporate database and the other two nodes will represent two individual retail store databases.

quickstart two tier

2.1. Installation

For information on how to install SymmetricDS, please refer to the Installation section of the SymmetricDS User Guide.

2.1.1. Creating and Starting

The Demo button will automatically install three nodes with synchronization pre-configured. This will allow you to see a working model of SymmetricDS.

wizard node setup
Figure 2. Open the web console and click Demo.

2.1.2. Initial Load

An initial load is the process of seeding tables at a target node with data from a source node. Instead of capturing data, data is selected from the source table using a SQL statement and then it is streamed to the client.

By default, the Demo does this action for you. However, it is worth noting that Initial Loads can be sent through the Manage→Nodes screen.

2.1.3. What’s Created

The demo databases are H2 Databases. You can connect to them using a sql explorer tool like Squirrel Sql. The connection information can be found in the properties files in the engines directory.

Please verify the databases by navigating to the Explore tab and using the database explorer on the left.

  • Find the item tables that sync from root to client (that is, from corp to store): item and item_selling_price.

  • Find the sales tables that sync from store to corp: sale_transaction and sale_return_line_item.

  • Find the SymmetricDS system tables, which have a prefix of "sym_", such as sym_channel, sym_trigger, sym_router, and sym_trigger_router.

  • Validate the corp item tables have sample data.

2.2. Pulling Data

Next, we will make a change to the item data in the central office corp node database (we’ll add a new item), and observe the data being pulled down to the store.

2.2.1. Create Data

Create data in corp for all stores to pull.

Navigate to the SQL Explorer for the corp node and execute (explore-execute-all) the following scripts.

insert into item (item_id, name) values (110000055, 'Soft Drink');
insert into item_selling_price (item_id, store_id, price)
        values (110000055, '001', 0.65);
insert into item_selling_price (item_id, store_id, price)
        values (110000055, '002', 1.00);
demo pull sql

2.2.2. Verify Outgoing Batches

demo pull verify batch
Figure 3. Verify the outgoing batches were created and sent (status of OK).

2.2.3. Verify Incoming Batches

demo pull verify batch
Figure 4. Verify the incoming batches were received (status of OK).

2.2.4. Verify SQL

Verify the change directly in a store database.

select * from item_selling_price
demo pull verify explore
Figure 5. Verify the new price for store 002 is 1.00
Make sure you have selected either store-001 or store-002 to run your query against.

2.3. Pushing Data

We will now simulate a sale at the store and observe how SymmetricDS pushes the sale transaction to the central office.

2.3.1. Create Data

Create data in a store to be pushed to corp. Navigate to the SQL Explorer for the corp node and execute (explore-execute-all) the following scripts.

insert into sale_transaction (tran_id, store_id, workstation, day, seq)
        values (1000, '001', '3', '2014-03-21', 100);

insert into sale_return_line_item (tran_id, item_id, price, quantity)
        values (1000, 110000055, 0.65, 1);