<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Divya Valsala Saratchandran - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Divya Valsala Saratchandran - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Thu, 14 May 2026 04:32:24 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/author/divyasaratchandran/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Use SonarQube to Improve Your Code Quality ]]>
                </title>
                <description>
                    <![CDATA[ SonarQube is a powerful open-source tool that helps you maintain code quality and security by analyzing your codebase for bugs and vulnerabilities. And it can play a major role when integrated into your CI/CD pipeline. In this tutorial, we will cover... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-improve-your-code-quality-with-sonarqube/</link>
                <guid isPermaLink="false">6815023dec2e34790eeb71a8</guid>
                
                    <category>
                        <![CDATA[ sonarqube ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Code Quality ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ci-cd ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Divya Valsala Saratchandran ]]>
                </dc:creator>
                <pubDate>Fri, 02 May 2025 17:34:53 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1746207275407/7b0da6c9-9bd7-40ca-853e-b1f7957acf3b.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>SonarQube is a powerful open-source tool that helps you maintain code quality and security by analyzing your codebase for bugs and vulnerabilities. And it can play a major role when integrated into your CI/CD pipeline.</p>
<p>In this tutorial, we will cover:</p>
<ol>
<li><p>What is SonarQube?</p>
</li>
<li><p>How SonarQube Improves Code Quality</p>
</li>
<li><p>Step-by-step Installation and Configuration</p>
</li>
<li><p>How to Run Your First Code Analysis</p>
</li>
</ol>
<h2 id="heading-what-is-sonarqube">What is SonarQube?</h2>
<p>SonarQube is an open-source tool that checks for code quality continuously. It analyzes code to find issues like duplication, bad practices, test coverage gaps, bugs, and vulnerabilities, giving detailed reports. It works with many programming languages like Java, C#, JavaScript, Python, TypeScript, and Kotlin.</p>
<p>You can add SonarQube to your CI/CD pipelines, IDEs, and version control systems like GitHub, GitLab, or Bitbucket. It provides detailed dashboards that show metrics, trends, and issues in your code.</p>
<p>You can use custom rules to enforce coding standards and reduce technical debt. SonarQube also supports code coverage analysis to help teams improve their tests. With the Quality Gate feature, teams can ensure only clean, maintainable code goes into production.</p>
<p>SonarQube offers both free and paid versions to suit any team size. Overall, it helps improve software quality and encourages good coding practices.</p>
<h2 id="heading-how-does-sonarqube-improve-code-quality">How Does SonarQube Improve Code Quality?</h2>
<p>Here’s how SonarQube helps improve code quality:</p>
<ol>
<li><p><strong>Early bug detection:</strong> Identifies bugs before they reach production</p>
</li>
<li><p><strong>Improved maintainability:</strong> Highlights code and design issues</p>
</li>
<li><p><strong>Security insights:</strong> Identifies vulnerabilities and security risks</p>
</li>
<li><p><strong>Code coverage:</strong> Integration with testing tools to monitor unit test coverage</p>
</li>
<li><p><strong>Customizable rules:</strong> Allows teams to set coding standards and policies</p>
</li>
<li><p><strong>Team collaboration:</strong> Ensures consistent code quality across development teams</p>
</li>
</ol>
<h2 id="heading-step-by-step-installation-and-configuration">Step-by-Step Installation and Configuration</h2>
<h3 id="heading-prerequisites"><strong>Prerequisites:</strong></h3>
<p>Here are the prerequisites that you will need before installing SonarQube</p>
<ol>
<li><p><strong>Java Runtime Environment(JRE)</strong>: Java 11 or above installed in your system.</p>
</li>
<li><p><strong>System Requirements</strong>: 2GB RAM minimum (Recommended: 4GB+).</p>
</li>
<li><p><strong>MacOS</strong>: You can use HomeBrew, which is the package manager for MacOS that simplifies the installation of software.</p>
</li>
</ol>
<p>Below are the steps to install SonarQube in your local machine:</p>
<h3 id="heading-download-sonarqube"><strong>Download SonarQube</strong></h3>
<p>Download the software from <a target="_blank" href="https://www.sonarsource.com/products/sonarqube/downloads/">sonarsource downloads</a> and choose the <em>Community Edition</em> for open-source projects.</p>
<h3 id="heading-extract-and-configure"><strong>Extract and Configure</strong></h3>
<p>To install SonarQube, you need to run the below command to unzip the file:</p>
<pre><code class="lang-bash">unzip sonarqube-&lt;version&gt;.zip
<span class="hljs-built_in">cd</span> sonarqube-&lt;version&gt;/bin/&lt;your-OS-folder&gt;
</code></pre>
<h3 id="heading-start-sonarqube"><strong>Start SonarQube</strong></h3>
<p>On Linux/Mac, you need to run the below command:</p>
<pre><code class="lang-bash">./sonar.sh start
</code></pre>
<p>On Windows, you need to run this one:</p>
<pre><code class="lang-plaintext">StartSonar.bat
</code></pre>
<h3 id="heading-access-sonarqube"><strong>Access SonarQube</strong></h3>
<p>To access SonarQube, you need to open browser and go to: <a target="_blank" href="http://localhost:9000">http://localhost:9000</a></p>
<p>Enter the default credentials:</p>
<ul>
<li><p><strong>Username:</strong> <code>admin</code></p>
</li>
<li><p><strong>Password:</strong> <code>admin</code> (you’ll be prompted to change it)</p>
</li>
</ul>
<p>The page will look similar to below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746152681985/0b1829cb-bd2a-4961-bc69-18f5d677d9dd.png" alt="SonarQube project creation page" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<h3 id="heading-set-up-sonarqube-in-your-project">Set Up SonarQube in Your Project</h3>
<p>To set up SonarQube in your project, start by opening the Java project on your machine. In the project root, create a <strong>sonar-project.properties</strong> file.</p>
<p>Add the below key value pairs in the file:</p>
<pre><code class="lang-bash">sonar.projectKey=spring-myproject
sonar.projectName=My Project
sonar.projectVersion=1.0
sonar.sources=.
sonar.host.url=http://localhost:9000
</code></pre>
<h2 id="heading-how-to-run-your-first-code-analysis">How to Run Your First Code Analysis</h2>
<h3 id="heading-configure-and-run-sonarscanner">Configure and Run SonarScanner</h3>
<p>SonarScanner is the tool that actually sends your code to SonarQube for analysis. Below are the detailed steps to follow to use it:</p>
<h4 id="heading-install-sonarscanner">Install SonarScanner:</h4>
<p>On Windows/Linux, download the software from <a target="_blank" href="https://docs.sonarsource.com/sonarqube-server/10.4/analyzing-source-code/scanners/sonarscanner/">SonarSource</a> and unzip it:</p>
<pre><code class="lang-bash">unzip sonar-scanner-cli-&lt;version&gt;.zip
</code></pre>
<p>On MacOS, run the below command:</p>
<pre><code class="lang-plaintext">&gt;brew install sonar-scanner
</code></pre>
<p>For both Windows/Linux and MacOS, verify the install by running the below command:</p>
<pre><code class="lang-plaintext">&gt;sonar-scanner -v
</code></pre>
<h4 id="heading-configure-sonarscanner">Configure SonarScanner</h4>
<p>After installing SonarScanner, you’ll need to configure it by setting the <strong>SonarQube server</strong> URL and <strong>authentication token</strong>. Then go to your SonarQube profile (top-right corner &gt; My Account &gt; Security) and generate a token.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746154994148/02ccf0cd-68ce-4447-bb1f-12ff04cd9e59.png" alt="Generate tokens in SolarQube" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>Provide a name for the token and click ‘Generate’:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746155102747/834dcbac-070e-4958-9cb7-44a738059343.png" alt="Name token and then generate" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>In the <code>sonar-project.properties</code> file in your project, add ‘sonar.login’ property and save.</p>
<pre><code class="lang-plaintext">sonar.projectKey=test-project
sonar.projectName=Test Project
sonar.host.url=http://localhost:9000
sonar.login=&lt;YOUR_TOKEN_HERE&gt;
</code></pre>
<h4 id="heading-run-the-analysis">Run the Analysis</h4>
<p>Once the SonarScanner is configured, you can start scanning your project.</p>
<p>In a terminal or command prompt, go to the root of your project (where sonar-project.properties is located).</p>
<p>Run the following command:</p>
<pre><code class="lang-plaintext">&gt;sonar-scanner
</code></pre>
<p>SonarScanner will analyze your code and push the results to your local SonarQube server. Visit <code>http://localhost:9000</code>, and you’ll see your project listed on the dashboard.</p>
<ul>
<li><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746151289131/d2794dc7-1a53-4787-8137-668849d50d2b.png" alt="Scanner results dashboard" class="image--center mx-auto" width="600" height="400" loading="lazy"></li>
</ul>
<p>To view the analysis report, go to <a target="_blank" href="http://localhost:9000/dashboard?id=java-sonar-demo">http://localhost:9000/dashboard?id=java-sonar-demo</a>:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746151477685/931d1170-3c90-45d2-ab07-b60b551f3856.png" alt="Analysis results" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<p>If you go to the ‘Issues’ tab at top left corner, you can view different categories of Software Quality, Severity of the Issues, and various other attributes in your code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746151632987/090c61d0-0a37-4bb1-82a1-76f149a4cc86.png" alt="Detailed results" class="image--center mx-auto" width="600" height="400" loading="lazy"></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Now you have installed and configured SonarQube and learned how to scan your code using SonarScanner. You can easily configure it in your projects for continuous code quality analysis.</p>
<p>This is a fantastic tool for keeping your code base clean and maintainable. As the next steps, you can consider adding test coverage reports, enforcing quality gates in your pipeline, and exploring SonarCloud for cloud-based analysis.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Data Synchronization for Edge Computing with SymmetricDS ]]>
                </title>
                <description>
                    <![CDATA[ Edge computing is a distributed system design that moves computation and data storage to where it’s most required – at the ‘edge’ of the network. Moving these tasks to the edge of the network enables computing in real time, which reduces the cost of ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/data-synchronization-for-edge-computing/</link>
                <guid isPermaLink="false">67d2cc837d28795ed4ea4d3e</guid>
                
                    <category>
                        <![CDATA[ symmetricds ]]>
                    </category>
                
                    <category>
                        <![CDATA[ edgecomputing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data synchronization ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud Computing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ POS System ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Divya Valsala Saratchandran ]]>
                </dc:creator>
                <pubDate>Thu, 13 Mar 2025 12:16:03 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1741798507678/d66ed2f3-4116-49ce-a4eb-06fcb7c36dc7.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Edge computing is a distributed system design that moves computation and data storage to where it’s most required – at the ‘edge’ of the network. Moving these tasks to the edge of the network enables computing in real time, which reduces the cost of bandwidth and latency significantly.</p>
<p>But edge computing environments face various problems, such as synchronizing data between edge nodes (like local devices) and central systems (which are usually cloud or data centers).</p>
<p>Luckily, there are tools that can help with this. In this article, I’ll teach you how to use the open source data synchronization and database replication tool SymmetricDS. You’ll learn how you can best use it in edge computing environments in any business domain.</p>
<p>I will walk you through the key concepts behind SymmetricDS, and discuss how it helps you optimize performance for edge computing. We’ll also look at a use case of data synchronization in the retail industry.</p>
<h2 id="heading-what-is-symmetricds">What is SymmetricDS?</h2>
<p><a target="_blank" href="https://symmetricds.org/about/">SymmetricDS</a> is an open source software tool used for data replication, synchronization, and integration between databases in distributed environments. Unlike traditional methods, where data synchronization tools are tailored for specific platforms or limited to the same database, SymmetricDS is designed and tailored to synchronize data between databases running on different platforms.</p>
<p>If you are working in an environment that requires only a single database type, and one-way synchronization is sufficient, traditional methods like database replication or scheduling ETL jobs might be an easier approach. But for complex environments that require more flexibility and real time integration (especially with edge devices like POS systems and industrial machines), SymmetricDS can give you a more adaptable solution.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Below are the prerequisites you’ll need before installing SymmetricDS:</p>
<ol>
<li><p><strong>Java Runtime Environment (JRE):</strong> Java 8.0 or above installed on your system.</p>
</li>
<li><p><strong>Database:</strong> Running instance of a supported database like MySQL, PostgreSQL, Oracle, SQL server etc. and be familiar on how to configure it.</p>
</li>
<li><p><strong>System Requirements</strong>: 2GB of RAM is recommended, and disk space requirements vary based on data volume and nodes involved in replication.</p>
</li>
</ol>
<h2 id="heading-understanding-symmetricds-architecture">Understanding SymmetricDS Architecture</h2>
<p>SymmetricDS provides a flexible edge computing architecture for data synchronization across multiple systems, including edge devices. Think of this tool as a flexible network that is setup as hub-and-spoke or peer-to-peer topology.</p>
<p>A hub-and-spoke topology has a central hub (cloud or on-premise server) that is connected to the spoke (edge) nodes. The central hub manages the configuration, orchestration, and monitoring of data synchronization, while these edge nodes capture and process data locally.</p>
<p>In peer-to-peer topology, there is no central hub and each edge node acts as both client and server sharing data with peers (edge nodes).</p>
<p>Each edge node runs its own SymmetricDS engine, which manages data synchronization for its local database. The synchronization process utilizes a pull-push model, where data changes are captured and queued at the edge, then transmitted to the central server or other nodes based on scheduled events or triggered by specific conditions.</p>
<p>One key advantage of using SymmetricDS in an edge environment is the ability to handle offline transactions efficiently. The edge nodes can operate autonomously during network interruptions and sync data once a network connection is available. This makes it ideal for retail POS systems, remote monitoring, and IoT deployments.</p>
<p>SymmetricDS consists of:</p>
<ul>
<li><p><strong>Nodes</strong>: Individual database instances participating in synchronization.</p>
</li>
<li><p><strong>Channels</strong>: Logical groupings of tables for efficient data routing.</p>
</li>
<li><p><strong>Triggers</strong>: Capture data changes (INSERT, UPDATE, DELETE).</p>
</li>
<li><p><strong>Routers</strong>: Determine where data updates should be sent.</p>
</li>
<li><p><strong>Batches</strong>: Data is grouped into batches before syncing.</p>
</li>
<li><p><strong>Conflict Resolution</strong>: Handles data conflicts in case of concurrent updates</p>
</li>
</ul>
<h2 id="heading-install-and-set-up">Install and Set Up</h2>
<h3 id="heading-step-1-download-and-install-symmetricds">Step 1: Download and Install SymmetricDS</h3>
<p>To get started with SymmetricDS, download and extract the file from the <strong>Community Edition</strong> (open-source) <a target="_blank" href="https://sourceforge.net/projects/symmetricds/files/latest/download">SourceForge.net</a> or <strong>Pro Edition</strong> (Licensed) from <a target="_blank" href="https://jumpmind.com">Jumpmind Inc</a>. Make sure JAVA_HOME is set in your machine.</p>
<h3 id="heading-step-2-create-a-database">Step 2: Create a Database</h3>
<p>Install a supported database (for example, MySQL, PostgreSQL, Oracle, SQL Server, and so on). Create a database schema and tables.</p>
<h3 id="heading-step-3-configure-a-node">Step 3: Configure a node</h3>
<p>Each participating database is a node. You define nodes in <code>symmetric-ds.properties</code>. Here’s an example configuration:</p>
<pre><code class="lang-sql">engine.name=my-node
db.driver=com.mysql.cj.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/mydb
db.user=root
db.password=root
sync.url=http://localhost:31415/sync/my-node
registration.url=http://localhost:31415/sync/hub
</code></pre>
<p>And here’s what’s going on in the above SQL:</p>
<ul>
<li><p><a target="_blank" href="http://engine.name"><code>engine.name</code></a><code>=my-node</code> assigns a name to the SymmetricDS instance.</p>
</li>
<li><p><code>db.driver=com.mysql.cj.jdbc.Driver</code> specifies the JDBC driver for MySQL.</p>
</li>
<li><p><code>db.url=jdbc:mysql://</code><a target="_blank" href="http://localhost:3306/mydb"><code>localhost:3306/mydb</code></a> points to the database URL.</p>
</li>
<li><p><code>db.user=root</code> &amp; <code>db.password=root</code> are credentials for database access.</p>
</li>
<li><p><code>sync.url</code> defines the URL for synchronization (where this node sends data).</p>
</li>
<li><p><code>registration.url</code> specifies the hub node URL that manages registrations.</p>
</li>
</ul>
<h3 id="heading-step-4-start-symmetricds">Step 4: Start SymmetricDS</h3>
<p>To start SymmetricDS, run the following command from the extracted folder:</p>
<pre><code class="lang-sql">./sym_service <span class="hljs-keyword">start</span>  <span class="hljs-comment"># On Linux/macOS</span>
sym_service.bat <span class="hljs-keyword">start</span>  <span class="hljs-comment"># On Windows</span>
</code></pre>
<p>This launches the SymmetricDS engine, which begins monitoring the configured database for changes.</p>
<h2 id="heading-define-synchronization-rules">Define Synchronization Rules</h2>
<p>One of the key components of SymmetricDS is its synchronization rules, which determine which data changes should be captured and routed across the edge nodes. These rules are configurable and define how and when the data is transferred between databases.</p>
<p>Here are some steps to consider while setting your synchronization rules:</p>
<h3 id="heading-step-1-define-a-node-group">Step 1: Define a Node Group</h3>
<p>In SymmetricDS, configuration rules are applied to groups of nodes. This helps control how the data flows between different nodes in a distributed environment.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_NODE_GROUP (node_group_id, description)
<span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'Store'</span>, <span class="hljs-string">'Store Node'</span>);
<span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_NODE_GROUP (node_group_id, description)
<span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'Corp'</span>, <span class="hljs-string">'Corp Node'</span>);
</code></pre>
<p>In this code,</p>
<ul>
<li><p>The <code>Store</code> group represents edge nodes (for example, store databases).</p>
</li>
<li><p>The <code>Corp</code> group represents the central hub node.</p>
</li>
</ul>
<h3 id="heading-step-2-define-group-links">Step 2: Define Group Links</h3>
<p>Group Links define which node group will initiate the synchronization for the data exchange. They help define the relationship between two or more node groups, specifying how and when data will flow between the groups.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_NODE_GROUP_LINK (source_node_group_id, target_node_group_id, data_event_action)
<span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'Store'</span>, <span class="hljs-string">'Corp'</span>, <span class="hljs-string">'P'</span>); // 'P' represents 'Push'
<span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_NODE_GROUP_LINK (source_node_group_id, target_node_group_id, data_event_action)
<span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'Corp'</span>, <span class="hljs-string">'Store'</span>, <span class="hljs-string">'W'</span>); // 'W' represents 'Wait for Pull'
</code></pre>
<p>Here,</p>
<ul>
<li><p>Stores push data (<code>'P'</code>) to the Corp node (for example, sending sales data to HQ).</p>
</li>
<li><p>Stores wait to pull (<code>'W'</code>) data from Corp (for example, receiving inventory updates).</p>
</li>
</ul>
<h3 id="heading-step-3-define-router-and-trigger-router-for-data-flow">Step 3: Define Router and Trigger Router for Data Flow</h3>
<p>Routers help filter the data that needs to be synchronized based on specific rules, such as based on the type of operation (insert, update, delete, and so on). It helps to ensure that only the necessary data gets routed to the correct destination by eliminating unnecessary data transfer.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_ROUTER (router_id, source_node_group_id, target_node_group_id, router_type, 
sync_on_update, sync_on_insert, sync_on_delete)
<span class="hljs-keyword">VALUES</span>(<span class="hljs-string">'corp to store'</span>, <span class="hljs-string">'corp'</span>, <span class="hljs-string">'store'</span>, <span class="hljs-string">'default '</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>);
<span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_TRIGGER_ROUTER (trigger_id, router_id, initial_load_order)
<span class="hljs-keyword">VALUES</span>(<span class="hljs-string">'user'</span>, <span class="hljs-string">'corp to store'</span>, <span class="hljs-string">'1'</span>);
</code></pre>
<p>This code does the following:</p>
<ul>
<li><p>Defines a router named <code>'corp to store'</code>, which synchronizes data from Corp to Store.</p>
</li>
<li><p>The <code>'default'</code> router type is used.</p>
</li>
<li><p><code>sync_on_update = 1</code> updates in Corp will be synced to Store.</p>
</li>
<li><p><code>sync_on_insert = 1</code> inserts in Corp will be synced to Store.</p>
</li>
<li><p><code>sync_on_delete = 1</code> deletes in Corp will be synced to Store.</p>
</li>
</ul>
<p>Now, we link this router to a trigger:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_TRIGGER_ROUTER (trigger_id, router_id, initial_load_order)
<span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'user'</span>, <span class="hljs-string">'corp to store'</span>, <span class="hljs-string">'1'</span>);
</code></pre>
<p>This makes sure that the trigger (user table changes) is routed according to the <code>'corp to store'</code> rule.</p>
<h3 id="heading-step-4-define-channels-for-synchronization">Step 4: Define channels for synchronization</h3>
<p>Channels define the logical grouping of data in tables that help organize and separate the data flows that make synchronization more efficient and scalable.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_CHANNEL (channel_id, max_batch_size, max_batch_to_send, max_data_to_route, 
enabled, batch_algorithm, description)
<span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'users'</span>, <span class="hljs-string">'10000'</span>, <span class="hljs-string">'100'</span>, <span class="hljs-string">'500000'</span>, <span class="hljs-string">'1'</span>, <span class="hljs-string">'default'</span>, <span class="hljs-string">'user data'</span>);
</code></pre>
<p>This code:</p>
<ul>
<li><p>Defines a channel named <code>'users'</code>.</p>
</li>
<li><p>Batches data into chunks of <code>10,000</code> rows per sync.</p>
</li>
<li><p>Ensures efficiency by limiting <code>100</code> batches per sync and <code>500,000</code> records per route.</p>
</li>
</ul>
<h3 id="heading-step-5-define-table-triggers">Step 5: Define Table Triggers</h3>
<p>Defining table triggers helps detect and manage changes in the database table. They serve as the event listeners that track changes in your source database. Without table triggers, the system wouldn’t know when to start syncing changes or which data to be synchronized.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> SYM_TRIGGER (trigger_id, source_table_name, channel_id)
<span class="hljs-keyword">VALUES</span> (<span class="hljs-string">'user'</span>, <span class="hljs-string">'user'</span>, <span class="hljs-string">'user'</span>);
</code></pre>
<p>This code tracks changes in the <code>user</code> table. Changes are routed through the <code>users</code> channel.</p>
<h3 id="heading-step-6-test-data-sync">Step 6: Test Data Sync</h3>
<p>To test synchronization, insert some test data into the source database:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">INSERT</span> <span class="hljs-keyword">INTO</span> <span class="hljs-keyword">user</span> (<span class="hljs-keyword">id</span>, <span class="hljs-keyword">name</span>, email) <span class="hljs-keyword">VALUES</span> (<span class="hljs-number">1</span>, <span class="hljs-string">'Alice'</span>, <span class="hljs-string">'alice@example.com'</span>);
</code></pre>
<p>Then run SymmetricDS sync and check if the record appears in the target database.</p>
<h3 id="heading-step-7-monitoring-and-troubleshooting">Step 7: Monitoring and Troubleshooting</h3>
<p>Check logs in <code>logs/wrapper.log file</code>. If a batch fails, check the error by running the following SQL query:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">SELECT</span> * <span class="hljs-keyword">FROM</span> SYM_OUTGOING_BATCH <span class="hljs-keyword">WHERE</span> ERROR_FLAG = <span class="hljs-number">1</span>;
</code></pre>
<p>As a result of executing the above query, it will retrieve the errored BATCH_ID. Run the following SQL to get the exact data of the failed batch:</p>
<pre><code class="lang-sql"><span class="hljs-keyword">SELECT</span> * <span class="hljs-keyword">FROM</span> SYM_DATA <span class="hljs-keyword">WHERE</span> data_id <span class="hljs-keyword">in</span> (<span class="hljs-keyword">select</span> failed_data_id <span class="hljs-keyword">from</span> sym_outgoing_batch 
<span class="hljs-keyword">WHERE</span> batch_id=<span class="hljs-string">'XXXXX'</span> <span class="hljs-keyword">and</span> node_id=<span class="hljs-string">'YYYY'</span>);
</code></pre>
<h2 id="heading-benefits-of-symmetricds-in-edge-computing">Benefits of SymmetricDS in Edge Computing</h2>
<p>In the context of edge computing, where data is being processed closer to the source (for example, POS systems, IoT devices, sensors, and so on), SymmetricDS offers several advantages to make it a robust tool for data synchronization:</p>
<ol>
<li><p><strong>Lower latency</strong>: SymmetricDS allows for local data processing and synchronization to the central server on regular intervals, reducing the latency involved with real-time processing in cloud environments.</p>
</li>
<li><p><strong>Bandwidth optimization:</strong> it transmits incremental changes rather than complete datasets, which reduces the need for continuous data transfer. This helps save bandwidth.</p>
</li>
<li><p><strong>Fault tolerance</strong>: it delivers data replication in disconnected environments, a key feature for edge computing where connectivity may be unreliable or intermittent. It also helps with offline processing.</p>
</li>
<li><p><strong>Scalability</strong>: it scales to numerous edge nodes and supports complex architectures, ensuring that performance improves even when more system features are added.</p>
</li>
</ol>
<h2 id="heading-use-case-how-symmetricds-solves-real-time-data-challenges-for-retailers">Use Case: How SymmetricDS Solves Real-Time Data Challenges for Retailers</h2>
<p>Imagine a retail chain of stores with multiple outlets in a country, state, or region. Every store is independent with its own local Point of Sale (POS) system, inventory system, and customer interaction databases.</p>
<p>But the head office depends on real-time information from all the stores for key decisions, such as inventory changes, generating sales reports, monitoring customer activity, and promotions. So the goal is to synchronize all this data from numerous store locations with low latency in such a way that inventory levels are accurate, transactions are properly recorded, and store operations are synchronized.</p>
<p>One of the most common issues in retail is inventory inconsistencies between stores. If an item is selling in one store, the inventory system must catch up with that immediately to prevent over-selling or under-stocking elsewhere. Traditional data synchronization approaches will bring delays or errors, leading to out-of-stock situations or overstocks in some stores.  </p>
<p>SymmetricDS provides a more reliable solution for real-time data synchronization across all stores and the central system. Whenever any product is sold at any store, SymmetricDS immediately updates the inventory data in both the local store system and the central database. This enables other stores to maintain the current inventory levels and prevent inconsistencies in the network.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>SymmetricDS has a robust feature set to streamline edge computing environments. Through its emphasis on incremental data synchronization, data compression and asynchronous replication, SymmetricDS streamlines performance in latency, bandwidth usage, and fault tolerance.</p>
<p>In a practical application, employing SymmetricDS in an edge computing environment can greatly enhance the efficiency of distributed applications, allowing for greater scalability, quicker decision-making, and less dependence on central servers.</p>
<p>By using the methods we’ve discussed here, edge devices can still operate autonomously, sync successfully with the main server, and maintain high-performance output even in peak conditions.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
