Developing your App
Primitive: Aggregations
Introduction

Introduction

Aggregations allow you to derive new datasets from existing database tables by slicing, summarizing, combining, filtering, and grouping data. These database-level transformations are defined using SQL SELECT queries, which contain your desired data transformation logic. Moose automatically creates a materialized view in your database using the provided query, which is continuously updated as new data is added to your source table(s).

Why Use Aggregations

Aggregations are ideal for:

  • Pre-computing results for frequently used queries.
  • Performing database-level transformations that should be consistently triggered as new data is ingested.
  • Ensuring high-performance querying and analysis by keeping transformed data readily available.
  • Creating reusable data subsets that can be utilized by other parts of your application, including other Aggregations and Consumption APIs.
  • Aggregation Lifecycle

  • Define: Write a SQL SELECT query that defines your desired data transformation.
  • Save: Save your query in the /aggregations folder of your project.
  • Execute: Moose executes your query to create a materialized view in your database.
  • Update: The materialized view is continuously updated as new data is added to your source table(s).