Data Models
Introduction
Data models, or transformations, are tables created by our analytics engineering team to present data in a shape that is easy to consume for analytics purposes. Orders facts, product dimensions, and user dimensions are all examples of potential entities (or tables) in a data model.
Creating data models is essential for transforming raw data into structured, meaningful, and usable formats that drive analytics, reporting, and decision-making. Well-designed data models also serve as the foundation for powering more robust and useful AI systems by providing clean, consistent inputs that improve model accuracy, reduce noise, and support richer feature engineering. In short, data models not only enable better business intelligence but also unlock the full potential of AI by ensuring data is trustworthy, well-organized, and aligned with real-world context.
Why Data Models Matter
🔧 Structure and Organization
- Data models define how data is organized, related, and stored.
- They bring consistency and clarity to how teams understand and query data.
Example: Instead of dealing with hundreds or even thousands of unconnected tables, a well-designed model organizes them into clean dimensions (like Customers, Products) and facts (like Revenue).
🤖 Unlock Full Potential of AI with Organized, Accurate, and Business-Ready Context
- Models provide the structured, high-quality data that machine learning systems rely on for accuracy and relevance.
- They enable richer feature engineering, reduce noise, and ensure AI outputs are grounded in business-ready context.
📊 Enable Reliable Analytics
- Models establish clean relationships between metrics and dimensions, reducing errors and ambiguity.
- They ensure that calculations like revenue, retention, or conversion rate are accurate and consistent across tools and users, creating a single source of truth.
🚀 Power Self-Service & Scale
- With intuitive, documented models (e.g., via dbt or semantic layers), non-technical users can explore data confidently.
- Teams avoid reinventing logic and reduce dependency on data engineers or analysts for every question.
🔒 Governance and Control
- Data models provide defined logic, lineage, and ownership, supporting governance, auditing, and compliance.
- They help enforce data quality checks, contracts, and access controls.
📐 Improve Performance and Efficiency
- Well-modeled data reduces duplication and streamlines queries.
- Optimized joins, indexing, and aggregations improve performance in warehouses and BI tools.
🧠 Support Business Understanding
- Models reflect the business logic—how the company defines a customer, transaction, or lifecycle stage.
- They bridge the gap between technical schemas and business needs.
How it Works
Chord utilizes the Kimball approach to data modeling. This is a widely used method in analytics and data warehousing that enables teams to build models that are easy to understand and utilize.
It breaks data into two core types of tables:
🧾 Fact Tables (fct_) – The “What Happened”
Fact tables track events or transactions, such as purchases, logins, or ad clicks. They include measurable data such as revenue, quantities, time of action, and user IDs.
Example: A table of all orders placed on your website, including order amount, date, and customer ID.
👤 Dimension Tables (dim_) – The “Who” and “What”
Dimension tables provide context for facts. They describe things like customers, products, or regions.
Example: A table of customer information with name, email, signup date, and status (active/inactive).
These two types of tables are designed to join together easily, allowing users to answer questions like:
- “How much revenue did we make from active customers last month?”
- “Which products are most popular among new users?”
🛠️ How Chord Builds Data Models
Step 1: Ingest Raw Data
Data often starts messy—coming from tools like:
- Shopify (orders, line items, products, etc.)
- Chord CDP (website client-side events and server-side events)
- Klaviyo (messaging)
- Facebook Ads (ad spend and metrics)
This data is loaded into a cloud data warehouse. However, at this point, it remains messy, inconsistent, and contains duplicates, inconsistent naming, or missing values. Additionally, each source typically contains tens or hundreds of separate tables that must be combined to make sense of the data.
Step 2: Clean and Normalize the Data
Chord utilizes dbt (short for data build tool), a transformation tool that helps data teams clean, organize, and document data as it flows from raw sources to clean, usable models. Chord's analytics engineers build these data models in layers in dbt using programming languages like SQL, python, jinja and YAML. The various data modelling layers allow us to:
- Clean the raw data (e.g., standardize names, remove junk values, Handle nulls, trims, formatting, or simple derived fields
- Deduplicate records
- Convert data types (e.g., string to timestamp)
- Filter out irrelevant rows (e.g., deleted or test records)
- Add flags like is_active
- Convert or standardize (e.g., currency conversion, unit standardization)
- Join related tables from different systems (e.g., linking a CDP session to a Shopify order)
- Enrich records with helpful metadata or flags
- Define metrics
Step 3: Organize into Facts and Dimensions
Once cleaned, the data is structured into:
- Dimension models like dim_customers, dim_products, dim_dates
- Fact models like fct_orders, fct_pageviews, fct_subscriptions
Step 4: Explode!
Chord utilizes an explosion technique to join every applicable dimension and fact table into a single, consolidated table, such as Orders, so that every field applicable to orders is now available in a single, unified table. We call these x_fct tables. Now, there's no need for one-to-many joins between dimension and fact tables, and instead, data is readily joined to immediately start analysis!
These data models models are versioned, documented, and tested in dbt to ensure reliability. They run daily (or even hourly), so dashboards and AI models always use fresh, trustworthy data.
Getting Started
Chord's data models power your AI, Analytics, and Activations in the Chord platform. You'll see data models such as Orders, Sessions, and more in your Explores section of Analytics. For the full list of models, along with each field therein, see the documentation in Chord Data Attribute Definitions.
if you have any questions or need help, please reach out to us at [email protected]