Delivery Patterns

A delivery pattern defines how data leaves a data product and reaches its consumers. Loxtep supports these delivery patterns, each optimized for a different integration style. Any data product — source or consumer — can have one or more delivery interfaces configured.

You configure most patterns from the Delivery tab on any data product's detail page. Database (Postgres) is a delivery-workflow Target on a Postgres connector (Direction = Delivery or Both) — see Configuring Delivery.

The Patterns

Webhook

Push data to an HTTP endpoint whenever the data product changes.

  • Mechanism: HTTP POST to a registered endpoint on change events
  • Latency: Real-time
  • Best for: Event-driven integrations, triggering downstream workflows, keeping external systems in sync

Webhooks fire automatically when new records arrive or existing records update. You configure the target URL, HTTP method, optional headers, and optional filters to control which changes trigger delivery.

{
  "delivery_type": "webhook",
  "endpoint_url": "https://app.example.com/hooks/orders",
  "method": "POST",
  "headers": { "X-Source": "loxtep" }
}

API Endpoint

Generate a queryable REST API for on-demand access to the data product.

  • Mechanism: Auto-generated REST endpoint that serves data on request
  • Latency: On-demand
  • Best for: Applications, microservices, dashboards, and any system that queries data synchronously

The generated API supports filtering, pagination, and field selection. Consumers query the endpoint when they need data rather than waiting for pushes.

To read a data product from Loxtep itself, run SQL scoped to it with loxtep_query → execute_query, loxtep data-products query in the CLI, or client.build.data_products.query in the TypeScript SDK.

Export

Bulk extract data on a schedule or as a one-time operation.

  • Mechanism: Scheduled or manual bulk extract to file (CSV, Parquet, JSON)
  • Latency: Batch
  • Best for: Reports, data sharing with partners, compliance archives, large dataset transfers

Exports run on a cron schedule or on demand. Output lands in cloud storage (S3, GCS) or is available for download. Format, compression, and partitioning are configurable.

{
  "delivery_type": "export",
  "format": "parquet",
  "schedule": "0 2 * * *",
  "destination": "s3://reports/orders/"
}

Database (Postgres)

Write destination-shaped rows into a table in your Postgres.

  • Mechanism: Delivery workflow (data-product-trigger → optional transform → outbound Postgres Target). Write policy lives on connection delivery_config.
  • Latency: Near real-time (queue-driven batch upsert/append)
  • Best for: Operational or analytics tables you already own

Auth and host stay on the org connector (password or RDS IAM). delivery_config holds table, write_mode, upsert primary_key, batch sizes, and conflict_update. Saving those keys under configuration is refused. A missing table or host fails the batch (missing_table / missing_host). See Configuring Delivery — Database (Postgres).

{
  "delivery_config": {
    "table": "analytics.customers",
    "write_mode": "upsert",
    "primary_key": ["customer_id"],
    "insert_batch_size": 1000
  }
}

SQL Query

Access data through the built-in analytics engine. Metabase, Tableau, Power BI, and Looker read the same table through a SQL grant.

  • Mechanism: Direct SQL access via the analytical engine, including a SQL grant for BI tools
  • Latency: On-demand
  • Best for: Ad-hoc analysis, data exploration, prototyping queries, analyst self-service, and BI tools

SQL Query exposes the data product as a queryable table. Run queries from the platform or the SDK, or grant SQL so a BI tool can query that table (or a shaped SQL table). A connection file is not a delivery method. Publish SQL, then grant sql to the people or domains who use the tool.

SELECT category, SUM(revenue) as total_revenue
FROM orders
WHERE order_date >= '2024-01-01'
GROUP BY category
ORDER BY total_revenue DESC;

Event Stream

Subscribe to real-time change events from the data product via the SDK.

  • Mechanism: SDK-based async iterable stream (reader/writer pattern)
  • Latency: Real-time
  • Best for: Streaming consumers, change data capture pipelines, real-time analytics, custom integrations

Event Stream uses the @loxtep/sdk to read from or write to a data product's underlying queue. The SDK resolves queue names, bot identities, and stream bus configuration automatically.

import { LoxtepClient } from '@loxtep/sdk';

const client = new LoxtepClient({ ... });
const reader = await client.get_reader('orders');
for await (const event of reader) {
  console.log(event);
}

Comparison Table

PatternMechanismLatencyBest For
WebhookPush to HTTP endpoint on changeReal-timeEvent-driven integrations
API EndpointGenerated REST for on-demand queryOn-demandApps, services, dashboards
ExportScheduled/one-time bulk extractBatchReports, data sharing, compliance
Database (Postgres)Queue-driven upsert/append into your tableNear real-timeOperational or analytics tables you own
SQL QueryAnalytics engine and SQL grantsOn-demandAnalysis, and BI tools on the table
Event StreamSDK reader/writer streamReal-timeStreaming consumers, CDC

Choosing a Pattern

Use this decision flow to pick the right delivery pattern for your use case:

User has a data product (source or consumer)
    │
    ├─ "I need to reshape/combine data first"
    │   └─ Go to Products → Projections → Design projection logic
    │       → Publish as Consumer Data Product
    │       → Then configure delivery (below)
    │
    └─ "I want to deliver data as-is (or I already have a consumer DP)"
        └─ Open data product detail → Delivery tab
            └─ Choose delivery pattern:
                ├─ Webhook — Push events to an endpoint on change
                ├─ API Endpoint — Generate a queryable REST API
                ├─ Export — Bulk extract (CSV/Parquet/JSON) on schedule
                ├─ Database (Postgres) — Upsert/append into your table
                ├─ SQL Query — Query the table, or grant SQL to a BI tool
                └─ Event Stream — Stream events via the SDK

Key questions to guide your choice:

  • Do you need real-time updates? → Webhook or Event Stream
  • Do consumers query on their own schedule? → API Endpoint or SQL Query
  • Is this a periodic bulk transfer? → Export
  • Do you write rows into a Postgres table you own? → Database (Postgres)
  • Are you feeding Metabase, Tableau, Power BI, or Looker? → a SQL grant on the queryable table or a shaped SQL table
  • Do you need ordered, replayable change events? → Event Stream

Delivery Workflows: Orchestration, Not a Separate Pattern

A Delivery Workflow (workflow_type: 'delivery') is an orchestration layer — not a separate delivery pattern. It starts with a data-product-trigger (the published source product) and ends on a Target connection. Use it to add transformations before data is delivered, and to author Postgres (and other) Targets that are not configured from the Delivery tab alone.

Think of it this way:

  • The patterns define where and how data arrives at its destination.
  • A Delivery Workflow defines what happens to the data on its way to delivery — enrichment, filtering, format conversion, quality checks, or fan-out to multiple targets. Outbound writers also need a delivery grant (save_delivery_grant / grants/{id}.json).

For example, you might configure a Delivery Workflow that:

  1. Receives change events from a data product
  2. Applies a quality validation step
  3. Transforms the payload into the consumer's expected schema
  4. Delivers via Webhook to one system AND via Export to a warehouse landing zone

Without a Delivery Workflow, delivery interfaces push data directly from the data product. With one, you insert processing steps between the data product and the delivery target.

Most simple integrations don't need a Delivery Workflow — configure the pattern directly on the Delivery tab. Use workflows when you need orchestrated, multi-step delivery logic.

Multiple Patterns Per Data Product

A single data product can have multiple delivery interfaces configured simultaneously. For example, a customer_360 consumer data product might deliver via:

  • Webhook → notify the CRM when a customer record changes
  • API Endpoint → serve the customer support dashboard
  • Export → land a scheduled batch in Snowflake for quarterly reporting
  • SQL → let the marketing team query the table in Metabase, Tableau, Power BI, or Looker

Each delivery interface operates independently with its own configuration, schedule, and health status.

Related Guides and Concepts