Skip to main content

Snowflake Overview

The SNOWFLAKE route stores MQTT messages in Snowflake, a cloud-native data warehouse. It supports high-volume data ingestion with automatic scaling and powerful SQL analytics.
Snowflake is ideal for large-scale analytics, data lakes, and enterprise reporting. Use it when you need to analyze IoT data alongside other business data in the cloud.

Basic Syntax


Connection Configuration

SNOWFLAKE_CONFIG Parameters

CONNECTION_STRING
string
required
Snowflake connection string with account, user, and password.
WAREHOUSE
string
Snowflake compute warehouse name.
DATABASE
string
Target database name.
SCHEMA
string
Target schema name. Default: PUBLIC.
ROLE
string
Snowflake user role.
QUERY_TIMEOUT
integer
Query timeout in seconds. Default: 60.
POOL_SIZE
integer
Connection pool size. Default: 10.
Never hardcode credentials in production. Use environment variables and encrypted secrets to keep sensitive values out of your route definitions:
See Environment Variables & Secrets for setup and usage.

Writing Data

Store sensor data in Snowflake:
Alternative: STORE IN with Models — Instead of writing EVENT queries, you can bind a model directly to this route. Every PUBLISH MODEL call automatically inserts a row — no query needed:
See Data Storage Overview for the full STORE IN workflow.

Reading Data

EVENTs also support SELECT queries to read data back from the database. Publish a message to the event’s SOURCE_TOPIC, and the query result is published to DESTINATION_TOPIC:
To trigger this query, publish the sensor ID to the source topic:
The query result is published to db/result/latest, where your actions or external clients can consume it.

Timed Polling

EVENTs can also run SELECT queries on a fixed schedule using WITH EVERY:

Table Schema Examples


Connection String Format


Troubleshooting

  • Verify account identifier is correct
  • Check username and password
  • Ensure warehouse exists and is running
  • Verify network allows Snowflake connections
  • Verify ROLE has INSERT permissions
  • Check user has access to WAREHOUSE
  • Ensure user can access DATABASE and SCHEMA
  • Increase QUERY_TIMEOUT value
  • Check warehouse size is adequate
  • Verify warehouse is not suspended

Next Steps

Data Storage Routes Overview

Compare all storage options.

File Storage Route

Configure local file storage.
Last modified on May 22, 2026