Lynk docs
  • Introduction
  • Reference
    • Data Modeling
      • Entities
      • Relationships
        • Entity-to-Entity Relations
        • Entity-to-Asset Relations
      • Features
        • Field
        • Metric
        • First-Last
        • Formula
        • Filters
        • Chaining Features
      • Measures
      • Data Assets
      • Time Aggregations
      • Lynk Functions
        • POP
      • Context
    • Consume & APIs
      • Authentication
      • SQL API
      • SQL REST API
      • Cache & Pre-Aggregations
    • Governance
    • Integrations
      • Git
      • Query Engines
    • AI Agents
Powered by GitBook
LogoLogo

Start now

  • Request Access

Website

  • Home
On this page
  • Types of features
  • Field
  • Metric
  • First-Last
  • Formula
  • Chaining features
  • Consuming features
  • Time aggregations
  • Governance
  1. Reference
  2. Data Modeling

Features

PreviousEntity-to-Asset RelationsNextField

Last updated 4 days ago

Features are entity-level attributes, representing all the things we know of entities. Lynk makes it simple to create features, based on related data assets or related entities.

Features represent the business logic of enriching entities with information based on other related assets or entities. Essentially, features can be thought of as dynamic dimensions.


Types of features

Field

Field features are great for enrichments from one-to-one or many-to-one relations. It is commonly used to enrich an entity with simple, non aggregate fields from one-to-one related assets or entities. See more in depth information on .

Metric

Metric features are great for aggregations from one-to-many relations. It is commonly used to enrich an entity with aggregated fields from one-to-many related assets or entities. See more in depth information on .

First-Last

First-Last features are great for enrichments of fields from one-to-many relations. It is commonly used to enrich an entity with fields of the first or last appearance of a one-to-many related assets or entities. See more in depth information on .

Formula

Formula features are used when we need to create calculated features on top of other features. It is commonly used to enrich an entity with more complex calculations that require multiple aggregations or calculations to be done first. See more in depth information on .


Chaining features

Lynk supports creating features based on previously created features on related entities.

For example, let's assume we have an entity called user and another entity called team, with in a many-to-one relationship. You can create a feature called is_active_user on the user level and consume it for creating a metric feature active_users_count on the team entity level.


Consuming features

For example, here is a simple SQL API request to get some features defined on a customer level:

-- A simple SQL API query

SELECT  customer_id,
        total_order_amount,
        first_order_date,
        last_order_status
FROM    entity('customer') 
WHERE   country = 'US'
LIMIT   100

Time aggregations


Governance

  • Features have unique names

  • Features have unique definitions

  • Monitoring relationship type to make sure feature definitions won't break

This allows building consistent, accessible and governed business logic - See for in depth information about this.

Features are consumed via , or via Lynk .

See for in depth information on this.

Lynk separates between business logic and time aggregations like rolling_window on the consumption layer. See for in depth information on this.

Lynk makes sure features are unique and trusted:

Field
features
Metric features
First-Last features
Formula features
chaining features
SQL API
REST API
Playground
consume
time aggregations
Governance