Gluesync Module · SQL and NoSQL modeling

2.3.2

Data modeling

Shape data between SQL and NoSQL without custom code. Write a SQL query and get flat or nested JSON documents, split one document into related SQL tables, and move your Gluesync 1.x data models over in one conversion.

Data modeling
Data pipelines · SQL Server sales → Couchbase

New Query entity ORDERS_DOC

Discard and exit
Targetcouchbase-dcp · demoScope sales · Collection orders_doc
FieldTypeDocument
ORDER_IDintKey
ORDER_NOvarchar (20)same name
STATUSvarchar (10)same name
ORDER_DATEdatesame name
CUSTOMER_NAMEnvarchar (100)PII:name
CUSTOMER_CITYnvarchar (60)same name
lines array4 fieldslines[]
Preview
1 root · 0 missing keys · 0 failures

ORDERS_DOC::1042

{  "ORDER_ID": 1042,  "ORDER_NO": "SO-01042",  "STATUS": "OPEN",  "ORDER_DATE": "2026-01-02",  "CUSTOMER_NAME": "Customer 7",  "CUSTOMER_CITY": "Lyon",  "lines": [    { "LINE_NO": 1, "SKU": "A-100", "QTY": 2, "PRICE": 49.0 },    { "LINE_NO": 2, "SKU": "B-220", "QTY": 1, "PRICE": 50.5 }  ]}
  1. 01 Write a query, preview the document
  2. 02 Split one document into related tables
  3. 03 Convert your Gluesync 1.x models

Why Data modeling

Data models should not live in custom code

01 / SQL to NoSQL

Joins do not fit a document store

An application wants one order document with its customer and lines inside. Building it means joining tables, watching every table in the join for changes and rewriting the right documents.

02 / NoSQL to SQL

A document does not fit one table

A document with arrays of cards and tokens belongs in several related tables. Splitting it by hand means keys, parent links and deletes handled in custom code.

03 / The platform outcome

Describe the shape once

Gluesync keeps documents and tables current from the same definition, and carries your Gluesync 1.x models over with one conversion.

How it works

From a definition to a live model in three steps

  1. 01

    Define

    A query, or a document

    Write the SQL query and add a level for each array, or choose the levels of the document to split. The wizard for Query entities walks the query, the key, the target mapping and the review.

  2. 02

    Check

    Describe, preview, validate

    Describe types the columns and returns the CDC verdict. Preview builds the first documents from the live source without writing them. Validate reports every issue at once.

  3. 03

    Run

    Snapshot, then CDC

    A snapshot loads the current data, then change data capture keeps every document and table in step with its source.

Capabilities

Query entities, document models and a path from 1.x

Data modeling runs inside Core Hub and the agents you already use. SQL Server CDC is the source of Query entities, Couchbase is the source of document models, and every definition is checked before it runs.

Query entities

SQL query in, JSON documents out

Flat or nested, kept current by CDC

The source of an entity is a SQL query. Joins, filters and sub-selects over your SQL Server tables become one document per root key, written to Couchbase and other NoSQL targets. Add a level for each array of child rows and the document nests them.

  • Flat documents, or nested documents with an array for each child level
  • SQL Server CDC reads every table the query touches: a change to a joined table updates every document it reaches
  • Describe shows the typed columns, the proposed key and the CDC verdict before anything runs
  • Preview builds the first documents from the live source without writing them
  • A guided wizard takes the entity from the SQL query through target mapping to review and save

View Query entities docs ↗

Data modeling
Data pipelines · SQL Server sales → Couchbase

ORDERS_DOC

RunningCDC Change a row in SQL Server

SQL ServerSQL Serversales

sales.ORDERS
ORDER_IDORDER_NOSTATUSCUSTOMER_ID
1042SO-01042OPEN7
1043SO-01043OPEN7
sales.CUSTOMERS
CUSTOMER_IDNAMECITY
7Customer 7Lyon
12Customer 12Turin
sales.ORDER_LINES
ORDER_IDLINE_NOSKUQTY
10421A-1002
10422B-2201
CouchbaseORDERS_DOC::1042
{  "ORDER_ID": 1042,  "ORDER_NO": "SO-01042",  "STATUS": "OPEN",  "ORDER_DATE": "2026-01-02",  "CUSTOMER_NAME": "Customer 7",  "CUSTOMER_CITY": "Lyon",  "lines": [    { "LINE_NO": 1, "SKU": "A-100", "QTY": 2, "PRICE": 49.0 },    { "LINE_NO": 2, "SKU": "B-220", "QTY": 1, "PRICE": 50.5 }  ]}

-- change a row, or wait for the next one

 

From joined tables to the document you need

Write the SELECT once. A flat entity gives one document per root row. Add a level and each array becomes part of the same document, rebuilt whenever a table it reads changes.

SQL TABLESONE QUERYONE DOCUMENT PER ORDERsales.ORDERSORDER_ID ORDER_NO STATUS CUSTOMER_ID1042 SO-01042 OPEN 7sales.CUSTOMERSCUSTOMER_ID NAME CITY7 Customer 7 Lyonsales.ORDER_LINESORDER_ID LINE_NO SKU QTY1042 1 A-100 2SQL queryjoins, filters, sub-selectslevel per arraySQL Server CDC keeps it currentFlatroot level only{ "ORDER_ID": 1042, "STATUS": "OPEN", "CUSTOMER_CITY": "Lyon"}Nestedroot plus a lines array{ "ORDER_ID": 1042, "STATUS": "OPEN", "CUSTOMER_CITY": "Lyon", "lines": [ { "LINE_NO": 1, "SKU": "A-100", "QTY": 2 }, { "LINE_NO": 2, "SKU": "B-220", "QTY": 1 } ]}

Gluesync 1.x migration

Bring your data models to Gluesync 2

Converted in Gluesync Automator, checked by Core Hub

Gluesync Automator turns the entities of a Gluesync 1.x configuration into Gluesync 2 entities on an existing pipeline, from its Import tab or the command line. It reports what became of every entity, and Core Hub checks every draft before anything is saved.

  • Upload the configuration, pick the pipeline and the Gluesync 1.x product, and convert: secret-looking keys are removed unread
  • The report lists every entity as flat, multi-level or document split, with the describe and validate result of Core Hub next to each draft
  • Choose the drafts to keep: nothing is saved without your confirmation
  • Migrated entities keep their behaviour: dates in custom formats, arrays and maps as JSON text, type discriminators and duplicate keys
  • Document ids are rendered as Gluesync 1 rendered them, so existing documents keep their ids
  • Then compare live documents with what the new entity writes, and cut over collection by collection

View migration docs ↗

Get Gluesync Automator →

Data modeling
Gluesync Automator DocumentationSupportIdleSign out

Import a GS1 (Gluesync 1.x) configuration

Convert GS1 entities into Gluesync 2 entities
Convert only: do not ask Core Hub to describe and validate the drafts Secret-looking keys are removed before the file is read. Converting saves nothing: choose the drafts in the report, then Save asks you to confirm.
4 drafts out of 4 GS1 entities. Nothing is saved yet.
SaveGS1 entityBucketConverter reportCore Hub checks
ORDERSMULTI_LEVEL
describe: CDC; proposed keys root [ORDER_ID]
validate: valid
CUSTOMERSFLAT
describe: CDC; proposed keys root [CUSTOMER_ID]
validate: valid
INVOICESMULTI_LEVEL
describe: CDC; proposed keys root [INVOICE_ID]
validate: valid
PRODUCTSFLAT
describe: CDC; proposed keys root [SKU]
validate: valid

Secret keys removed unread: none

Same behaviour, same output

Dates in custom formats, arrays and maps as JSON text, type discriminators, duplicate keys and document ids come out of the migrated entity the way they came out of the 1.x one.

SAME BEHAVIOUR, SAME OUTPUTGluesync 1.xGluesync 2Date in a custom formatOrderDate "15/03/2021" → 2021-03-15OrderDate "15/03/2021" → 2021-03-15identicalArray kept as JSON textItems = [{"id":1},{"id":2}]Items = [{"id":1},{"id":2}]identicalType discriminator"type": "order""type": "order"identicalTwo items, same keyone row, the last item winsone row, the last item winsidenticalDocument idORDERS::1042ORDERS::1042identical

FAQ

Frequently asked questions

What is a Query entity?

An entity whose source is a SQL query instead of a table. Gluesync writes one document per root key, flat or with nested arrays of child rows, and keeps it current as the source tables change.

Which source and targets do Query entities use?

The source is SQL Server with change data capture. Documents are written to Couchbase and other NoSQL targets, as flat JSON or as multi-level JSON with an array per child level.

How does a change in a joined table reach the documents?

SQL Server CDC reads the change tables of every table the query reads. Gluesync finds the documents a change touches, reads them again from the source and writes them whole, so a change to a customer updates every order document that holds it.

Can I check a query before saving the entity?

Yes. Describe returns the typed columns, the proposed key, the tables read and the CDC verdict without running the statement. Preview shows the documents the query would write, with their ids, and validate reports every issue at once. Preview values are masked like Query Studio results.

What does a document model do?

It splits one Couchbase document into SQL Server tables, one level per table, each with its key and a link to its parent. Embedded objects become columns of the parent row or tables of their own, and arrays of scalars become rows.

How are deletes handled in a document model?

Each level has its own delete policy. Apply removes the rows, report only keeps them and records what would have been deleted, and off ignores deletes. Chain scope reaches child tables whose keys do not carry the root key.

How do I migrate Gluesync 1.x data modeling?

Open Gluesync Automator, or run its command line, upload the 1.x configuration, pick the pipeline and the Gluesync 1.x product, and convert. The report lists every entity and Core Hub checks each draft. You choose the drafts and confirm the save, and nothing is saved without that confirmation. Then compare live documents with what the new entity writes and cut over collection by collection.

Where does the Gluesync 1.x conversion run?

In Gluesync Automator, from the Import tab or the command line. Both run the same steps: convert the configuration, let Core Hub describe and validate every draft without writing anything, then save the drafts you choose once you confirm.

Do migrated entities behave like the 1.x ones?

Yes. They keep dates in custom formats, arrays and maps written as JSON text, type discriminators, duplicate keys with the last item winning, and Gluesync 1 document ids.

Where do I configure data modeling?

In the Control Plane, where a guided wizard walks Query entities from the SQL query to the review, and through the REST API and the MCP server. The conversion of Gluesync 1.x models runs in Gluesync Automator.

Resources

Guides, roadmap and support

Roadmap

Public Roadmap

What we're building next. Submit feature requests.

View roadmap ↗
Support

Support

Access technical support and operational assistance.

Get support →
Status

Service Status

Real-time platform availability and incident history.

Check status ↗

Model your data once, keep it current

Request a free trial or talk with the MOLO17 team about SQL to NoSQL modeling and migrating your Gluesync 1.x models.