Federated queries

Join unlike systems without pretending they are the same database.

FedCLI provides one SQL-oriented operating surface while preserving the execution realities of the source systems involved.

Execution model

A query that targets one connected source can execute directly on that remote system. When a workflow spans unlike sources, FedCLI can stage source rows into an execution workspace for the final join, filter, or aggregation.

This is an execution-placement model, not a claim that every backend exposes identical SQL semantics or performance characteristics.

Homogeneous federation job: reconcile two Oracle estates

Federation can still be useful when the source engines share a dialect but are separate operational systems. This example compares open order records in an ERP Oracle target with invoice state in a finance Oracle target.

-- oracle-order-reconciliation.sql
SELECT e.ORDER_ID, e.STATUS AS order_status, f.STATUS AS invoice_status
FROM ORDERS@ERP_ORACLE e
JOIN INVOICES@FINANCE_ORACLE f ON e.ORDER_ID = f.ORDER_ID
WHERE e.STATUS = 'OPEN';

Both aliases represent Oracle systems, but the workflow crosses independently managed source boundaries. Where an environment already has an appropriate database-native link, compare it with the FedCLI workflow using the real security, network, and operational constraints rather than assuming one is always faster.

Heterogeneous federation job: correlate Oracle, MongoDB, and DynamoDB

For unlike engines, preserve each source's role and use the shared workflow for the final relationship.

-- customer-exposure-review.sql
SELECT o.ORDER_ID, c.name, d.account_tier
FROM ORDERS@ERP_ORACLE o
JOIN users@CRM_MONGODB c ON o.CUSTOMER_ID = c.customer_id
JOIN Accounts@BILLING_DYNAMODB d ON o.CUSTOMER_ID = d.CustomerId
WHERE o.STATUS = 'OPEN';

The alias names, table shapes, credentials, and access controls are specific to your environment. Validate each source query independently before turning a cross-source operation into a scheduled task.

Make either pattern a repeatable job

Keep one federated statement per versioned script, prove it interactively first, and then invoke it through the same CLI surface.

fedcli @oracle-order-reconciliation.sql
fedcli @customer-exposure-review.sql

Schedule the wrapper only after defining the permitted data scope, output destination, timeout, monitoring, and recovery action for that specific job.

Use a safe operator workflow

  1. Connect to each intended target and inspect its schema or collection shape.
  2. Start with bounded projections and filters rather than broad extraction.
  3. Run the federated statement interactively and review the output.
  4. Move the proven statement into a versioned script only when its source permissions and data volume are understood.

Next steps

Review the supported database guide for engine coverage and the automation guide before operationalizing a repeatable task.