Historical Sync

Updated by Devinder Singh

Introduction

Byteline Data Sync efficiently synchronizes existing data in both apps so that you can keep valuable data. This process is called historical sync. The process involves getting existing data from both apps and then updating, creating and deleting records to make the data in sync.

For 2-Way sync, records can be updated on both apps. However, for 1-Way sync, records are updated only on the target app.

Understanding Unique Keys in Data Sync

When you're syncing data between two different apps using Byteline's Data Sync, you want to make sure that the information is matched up correctly. This is where unique keys come into play. Don't worry if you're not a tech expert—this guide will break it down for you in simple terms.

What Are Unique Keys?

Think of unique keys as special identifiers for your data. Imagine you have two lists—one from App A and one from App B—and each list contains names and email addresses. A unique key could be something like an email address because it’s a piece of information that is unique to each person on your list. No two people should have the same email address, right? So, this unique piece of information helps Byteline figure out who’s who when syncing the data between your two apps.

Why Are Unique Keys Important?

When you’re syncing data, you might have records in both App A and App B that need to be matched up. If you don’t use unique keys, Byteline won’t know how to correctly pair the records from one app to another. Unique keys ensure that the information for "John Doe" in App A matches up with the information for "John Doe" in App B, even if the two apps store the data slightly differently.

How Do Unique Keys Work?
  1. Choosing Your Unique Key: The first step is to choose what your unique key will be. In many cases, it’s something straightforward like an email address or a customer ID. You’ll pick this key when setting up your data sync for the first time.
  2. Historical Sync: When you run your sync for the first time, Byteline looks at the unique keys you’ve chosen to match up existing records between your two apps. This process is called a historical sync, meaning it’s looking at data that’s already there, not just new data.
Simplifying Your Data Sync Experience

Byteline’s use of unique keys makes data syncing straightforward, even if you’re not a technical whiz. You don’t need to understand complex programming or database management—just pick the right piece of information (like an email address), and Byteline will do the heavy lifting for you.

Unique keys might sound technical, but they’re really just a simple way to make sure your data stays accurate when syncing between apps. By using unique keys, Byteline ensures that your information is always matched up correctly, saving you time and hassle.

Selecting Unique Keys

On the fields mapping screen, you simply need to review and modify the unique key selection if necessary. For most integrations, this key is automatically selected. However, if the default selection does not accurately represent your data, it is recommended to be changed.

Unique keys can be changed from the "Map fields" screen of the data sync configuration. If you're not currently on this screen, Edit the sync and go to this screen.

The current selection is shown in green.

Note: Unique keys are only considered for the historical sync, i.e., to sync existing data. Once a sync is active, unique keys are not checked.

Toggle Unique key selection

You can click on the unique key button and confirm the selection. This toggles the value.

How to trigger historical sync?

The historical sync is automatically performed when a sync is started. Once a sync is live, our ongoing sync process will keep your data in sync.

If you're planning to change the structure of your tables and want to perform historical sync afterward. You should follow the below steps:

  1. Stop the sync.
  2. Make modifications to your table(s) structure.
  3. Edit the sync for the new table structure.
  4. Make the sync live, which will perform the historical sync.

Troubleshooting

The record count doesn't match

You have completed the historical sync but subsequently discovered a discrepancy in the record counts between the tables of the two apps. This situation often arises when incorrect unique key(s) are selected. Occasionally, a field designated as a unique key may not be truly unique. To ensure accuracy, you can verify the validity of the unique key(s) by counting the distinct values across all rows. The resulting count should match the total number of rows.

Please note that you have the option to select multiple fields as unique. In such cases, Byteline considers the values of both fields as criteria for matching records (using an AND condition).


How did we do?