LogoLogo
Go to Syntho.AI
English
English
  • Welcome to Syntho
  • Overview
    • Get started
      • Syntho bootcamp
        • 1. What is Syntho?
        • 2. Introduction data anonymization
        • 3. Connectors & workspace creation
        • 4. PII scan
        • 5. Generators
          • Mockers
          • Maskers
          • AI synthesize
          • Calculated columns
          • Free text de-identification
        • 6. Referential integrity & foreign keys
        • 7. Workspace synchronization & validation
        • 8. Workspace & user management
        • 9. Large workloads​
        • 10. Data pre-processing
        • 11. Continuous Success
      • Prerequisites
      • Sample datasets
      • Introduction to data generators
    • Frequently asked questions
  • Setup Workspaces
    • View workspaces
    • Create a workspace
      • Connect to a database
        • PostgreSQL
        • MySQL / MariaDB
        • Oracle
        • Microsoft SQL Server
        • DB2
        • Databricks
          • Importing Data into Databricks
        • Hive
        • SAP Sybase
        • Azure Data Lake Storage (ADLS)
        • Amazon Simple Storage Service (S3)
      • Workspace modes
    • Edit a workspace
    • Duplicate a workspace
    • Transfer workspace ownership
    • Share a workspace
    • Delete a workspace
    • Workspace default settings
  • Configure a Data Generation Job
    • Configure table settings
    • Configure column settings
      • AI synthesize
        • Sequence model
          • Prepare your sequence data
        • QA report
        • Additional privacy controls
        • Cross-table relationships limitations
      • Mockers
        • Text
          • Supported languages
        • Numeric (integer)
        • Numeric (decimal)
        • Datetime
        • Other
      • Mask
        • Text
        • Numeric (integer)
        • Numeric (decimal)
        • Datetime
        • UUID
      • Duplicate
      • Exclude
      • Consistent mapping
      • Calculated columns
      • Key generators
        • Differences between key generators
      • JSON de-identification
    • Manage personally identifiable information (PII)
      • Privacy dashboard
      • Discover and de-identify PII columns
        • Identify PII columns manually
        • Automatic PII discovery with PII scanner
      • Remove columns from PII list
      • Automatic PII discovery and de-identification in free text columns
      • Supported PII & PHI entities
    • Manage foreign keys
      • Foreign key inheritance
      • Add virtual foreign keys
        • Add virtual foreign keys
        • Use foreign key scanner
        • Import foreign keys via JSON
        • Export foreign keys via JSON
      • Delete foreign keys
    • Validate and Synchronize workspace
    • View and adjust generation settings
  • Deploy Syntho
    • Introduction
      • Syntho architecture
      • Requirements
        • Requirements for Docker deployments
        • Requirements for Kubernetes deployments
      • Access Docker images
        • Online
        • Offline
    • Deploy Syntho using Docker
      • Preparations
      • Deploy using Docker Compose
      • Run the application
      • Manually saving logs
      • Updating the application
    • Deploy Syntho using Kubernetes
      • Preparations
      • Deploy Ray using Helm
        • Upgrading Ray CRDs
        • Troubleshooting
      • Deploy Syntho using Helm
      • Validate the deployment
      • Troubleshooting
      • Saving logs
      • Upgrading the applications
    • Manage users and access
      • Single Sign-On (SSO) in Azure
      • Manage admin users
      • Manage non-admin users
    • Logs and monitoring
      • Does Syntho collect any data?
      • Temporary data storage by application
  • Syntho API
    • Syntho REST API
Powered by GitBook
On this page
  • How to apply PK / FK generators
  • On column level
  • On workspace level
  • On composite keys
  • Data types
  • Limitations & considerations

Was this helpful?

  1. Configure a Data Generation Job
  2. Configure column settings

Key generators

PreviousCalculated columnsNextDifferences between key generators

Last updated 15 days ago

Was this helpful?

Syntho's Primary Key (PK) and Foreign Key (FK) generation methods are designed to enhance data privacy, integrity, and uniqueness across various tables. These methods generate unique hash values that mimic input data formats, ensuring referential integrity and maintaining the data structure.

Syntho offers three key generators to handle various scenarios for managing and transforming primary and foreign keys. Below are the descriptions and recommended use cases for Duplicate, Generate, and Hash.

How to apply PK / FK generators

On column level

Syntho beta feature

Go to Column settings > Generation Method, and select one of the available methods: Duplicate, Generate or Hash.

On workspace level

Setting a key column at the column level overrides the workspace's default key generation method. For example, if "Hash" is the default key generation method but "Duplicate" is set on the column level for "key_column," then "key_column" will use "Duplicate."

  • Use the shortcut CTRL + SHIFT + ALT + 0 to open Workspace Default Settings and change the key generation method according to your choice by simply replacing the value to either "duplicate", "generate" or "hash" . Please note that it will apply the generator across the entire workspace.

  • Alternatively, you can add /global_settings to the end of the workspace URL to open Workspace Default Settings.

On composite keys

  • The generator supports composite keys and ensures consistency across all columns that form the composite key.

Setting one composite key column to use a generation method automatically sets the other composite key columns to the same method as well in UI. Attempting to change the generation method for one composite key column (e.g., from "hash" to "duplicate" or "generate") will result in all composite key columns being reset to the same generation method. The UI shows linked key generation methods, but the destination database will have the correct independent generation methods applied.

Data types

  • Textual data:

    • Hash key values ensure unique and protected data while maintaining the original text structure.

  • Numeric data:

    • Generation methods apply unique hashes to maintain numeric data privacy and integrity.

  • Date/Time data:

    • Composite keys involving date/time fields will see all parts of the composite key aligned to the same generation method when hashes are applied.

The examples below shows two different composite keys. In the first image, the columns "Birthdate" and "First" are applied "generate" and "hash", respectively.

In the case below, the columns "Birthdate" and "Birthplace" are applied "hash" and "generate", respectively.

Limitations & considerations

  • Composite foreign keys are not supported in the following situation:

    • when two or more columns that make up the composite foreign key also serve as a composite primary key in a referred other table, AND

    • the key generation method is set to generate

  • Generators are not applied to tables in Exclude mode.

  • Consistency is enabled (same input → same output) to preserve links between PK and FK columns.

  • Generation of keys for non-textual or highly complex data types, like images or large binary objects, is not supported.

Applying PK/FK generators on column level
Columns "Birthdate" and "First" are composite keys
Columns "Birthdate" and "Birthplace" are composite keys

Syntho supports three types of key generators to handle referential integrity:

Method
Description
When to use
When not to use

Duplicate

Copies the original key values exactly as they appear in the source data, preserving both the correlations and referential integrity between primary and foreign keys.

When it’s essential to maintain the original key values and relationships, particularly in de-identification scenarios where the data structure must be preserved without generating new keys.

Upsampling is not supported when using Duplicate, as the original keys are simply copied, not expanded. Additionally, it is not recommended when the keys are sensitive and need to be protected, as this method retains the original key values without obfuscation.

Generate

Creates new, synthetic key values that do not correspond to the original keys. It preserves only the referential integrity, but not the correlations between key columns.

Use Generate for upsampling or creating synthetic datasets where there is no need to maintain relationships with the original data. It can also be used when creating data from scratch.

The Generate function creates new keys independently of the original key order, which disrupts correlations. As a result, it is unsuitable for scenarios where maintaining the correlations and order is essential.

Hash

Converts original key values into hashed representations. Both correlations between tables and relational integrity are maintained.

Use Hash when you need to obscure the original key values, while ensuring correlations and referential integrity are preserved.

Upsampling, or situations where the original key values must be maintained for direct referencing, such as cases where exact key values are essential for business logic (e.g. country codes) or traceability in audit scenarios.

Key generators