Collect and forward analytics events to your ClickHouse tables.
Find it on GitHub: /edgee-cloud/clickhouse-component
ClickHouse is an open-source columnar database that allows you to generate analytical reports using SQL queries in real-time.
Here’s how Edgee events map to ClickHouse records:
Edgee Event | ClickHouse record | Description |
---|---|---|
Page | A new record in the configured table | Full JSON dump of the Page event |
Track | A new record in the configured table | Full JSON dump of the Track event |
User | A new record in the configured table | Full JSON dump of the User event |
To integrate ClickHouse into your Edgee project:
edgee/clickhouse
from the list of available components.Before ingesting events, you’ll ned to create a new table with the following schema, depending on your ClickHouse version and JSON
support:
New records are ingested individually using JSONEachRow
.
If your ClickHouse version supports JSON
or Object('json')
types, both context
and data
will contain additional JSON sub-fields, whose schema is automatically inferred at runtime.
Please note that:
context
are always the same, so you can use queries such as SELECT context.client.ip AS ip FROM edgee
data
depend on the value of event_type
, so you can use queries such as:
SELECT data.Track.name FROM edgee WHERE event_type = 'Track'
SELECT data.Page.path FROM edgee WHERE event_type = 'Page'
When configuring the component in your Edgee Data Layer or within SDK calls, use edgee/clickhouse
as the component name:
For more details on ClickHouse implementation, refer to the official ClickHouse HTTP API documentation.