Data sources
Map of concepts
Map of concepts
Data sources: usage data stored in your systems
A data source is a system in your data infrastructure that stores usage data. Zenskar reads each data source through one data-source connector, such as PostgreSQL. The connection settings of the data source, such as its address and credentials, tell the data-source connector how to reach it. Zenskar reads the usage data in a data source, such as the tableapi_calls in your data system, in one of two ways:
- It copies the usage data on a schedule. The data source is then a synced data source.
- It queries the usage data in place. The data source is then a remote data source.
Data-source connectors: how Zenskar reads a data source
A data-source connector is the software component through which Zenskar reads one kind of data source, such as PostgreSQL. Zenskar has 16 data-source connectors, in three groups. Each data-source connector has its own connection settings, which its document explains:Data-source access: synced or remote
A data source gives Zenskar access to its usage data in one of two ways:- A synced data source is a data source whose usage data Zenskar copies on a schedule.
- A remote data source is a data source whose usage data Zenskar queries in place.
This conceptual diagram shows how a data-source connector turns the usage data of a synced data source into synced usage data.
Zenskar does not translate the query, so you write it in the SQL of the remote data source, such as GoogleSQL for BigQuery.
This conceptual diagram shows how a billable metric reads the usage data of a remote data source.
The data-source connector decides which access is possible:
When both are possible, a remote data source is the default. The access is part of the connection settings, so it cannot change after the data source is created.
Sync frequency: how current the synced usage data is
The sync frequency is how often Zenskar updates the synced usage data of a synced data source. The sync frequency is every 1, 2, 3, 4, 6, 12, or 24 hours, and the default is every 12 hours. A sync can also run on demand, between scheduled syncs. Syncing can be paused and resumed. While syncing is paused, the synced usage data stays as it was at the last sync. Usage data that reaches the data source after the last sync is not in the synced usage data until the next sync, so a billable metric does not see it yet. See Change the sync frequency. See Sync now, pause, or resume syncing.Cursor columns: which rows a sync adds
A cursor column is a column of a chosen table whose values tell Zenskar which rows are new since the last sync. With a cursor column, each sync adds the new rows to the table in the synced usage data. For example, with the cursor columntimestamp, each sync adds the rows of api_calls whose timestamp is later than any row at the last sync. Without a cursor column, each sync replaces the whole table. A cursor column must be one of the chosen columns.
See Choose the tables and columns to sync.