Federated queries

One of FeatureQL's core strengths is its ability to federate data from multiple heterogeneous sources within a single query. This enables building features that span across databases, caches, APIs, and other data systems seamlessly.

Cross-source data federation

This powerful example demonstrates federated querying across multiple data sources:

Data sources involved:

  1. Redis: Contains order details (order:* keys with JSON data)
  2. PostgreSQL: Contains customer information with last order references
  3. FeatureQL: Orchestrates the join between these sources

Federation workflow:

  1. Customer lookup: Query PostgreSQL for customer details and last_order_id
  2. Order enrichment: Use the last_order_id to fetch order details from Redis
  3. Cross-source join: ADD_FIELDS() links Redis order data to PostgreSQL customer data
  4. Type-safe binding: Entity annotations (BIGINT#ORDERS, BIGINT#CUSTOMERS) ensure referential integrity

Key federation features:

  • Multi-source joins: Combine data from different storage systems
  • Type safety: Entity relationships are preserved across sources
  • Performance: Each source is queried optimally using its native access patterns
Last update at: 2025/10/13 10:23:46