Skip to content

Warehouse load

The warehouse load copies your event archive into a table in your own warehouse, every 15 minutes, along with your organization’s EdgeKit records. EdgeKit runs it for your organization once you give it access to the warehouse.

Additional destinations can be added on request.

Every valid event in your event archive, for all your sites, into one table. Bad rows are never loaded.

Beside the events, each load copies your organization’s EdgeKit records, such as users, grants, traits and profiles, into a schema of their own, edgekit_v1. See Export schema.

The table is edgekit.events unless you ask for another <schema>.<table> (<dataset>.<table> on BigQuery). The default name does not collide with an atomic.events table you may already load from Snowplow.

  • The event’s own fields: Snowplow’s atomic.events columns, in Snowplow’s order, such as event_id, event, collector_tstamp, derived_tstamp, domain_userid, user_id and page_url. A few columns Snowplow itself no longer fills are left out: the br_features_* and *_base columns, and etl_tags.
  • One JSON column per schema major: unstruct_event_<vendor>_<name>_<model> holds a self-describing event’s data as an object, and contexts_<vendor>_<name>_<model> holds the entities of one schema as an array, in the order they were attached. On Snowflake these are VARIANT columns, and on BigQuery and MotherDuck JSON columns. See Versions for how the names are made.
  • The site, in contexts_cloud_edgekit_tenant_1: an array holding one object, whose site_id is the event’s site and whose deployment is the deployment that judged it.
  • Columns the load adds for its own bookkeeping, such as when the archive file holding the row was written.

A column is added the first time a load carries it, for example after you deploy a new schema major. Rows loaded earlier hold null in it.

On Snowflake, events per site:

SELECT contexts_cloud_edgekit_tenant_1[0]:site_id::string AS site_id, COUNT(*) AS events
FROM edgekit.events
GROUP BY 1
ORDER BY 2 DESC;

A load runs every 15 minutes. Each run reads the archive files written between 30 and 2 minutes before it started, so every file is read at least once and most twice. Rows are merged on event_id, so reading a file twice adds no rows. Two copies of one event that arrived in files far apart can both remain; see Are events counted twice?.

A load that fails or does not run can leave a gap. EdgeKit fills a gap by loading the missing days again, which is safe for the same reason.

The scheduled load starts from the moment EdgeKit turns it on. EdgeKit then backfills your archive, one day at a time, from the start of your archive or from a date you choose.

There is no console screen for the warehouse load. Create the access below in your warehouse, and give EdgeKit the connection details:

  • Snowflake: two schemas owned by a role of its own, one for the events and EDGEKIT_V1 for the export schema, that role’s use of the database and of a warehouse, and a service user on key-pair authentication with that role. The load creates the tables in those schemas, and a temporary table there for each load.
  • BigQuery: a service account with BigQuery Data Editor on two datasets, one for the events and edgekit_v1, and BigQuery Job User.
  • MotherDuck: a token of a service account that owns that one database and nothing else. A MotherDuck token cannot be limited to one database, so the account is the limit.

EdgeKit stores the connection for your organization. To stop loading, ask EdgeKit to remove it. The tables and every row in them stay.

What is in your warehouse is your organization’s copy. Its retention, and deleting from it, are yours: EdgeKit never deletes rows from your events table. Erasing a user in EdgeKit does not remove their events from your warehouse, as it does not remove them from your event archive. An erasure does reach the export schema’s tables: the next load nulls the user’s email address there, and their profiles and own trait values leave within a day.

edgekit.ai