Semantic Layer Deployment¶
Deploy semantic models and metrics to production data warehouses for BI tool consumption.
Deployment Overview¶
Seeknal deploys semantic models and metrics to StarRocks, creating optimized materialized views that BI tools can query directly.
Pre-Deployment Checklist¶
Before deploying, ensure:
- Semantic models are tested and validated
- Metrics are calculated correctly
- Performance is acceptable
- Access controls are configured
- Documentation is complete
Deploying to StarRocks¶
Initial Deployment¶
# Deploy all semantic models and metrics
seeknal deploy-semantic-layer
# Deploy specific model
seeknal deploy-semantic-layer --model ecommerce_semantic_model
# Deploy with environment
seeknal deploy-semantic-layer --env production
What Gets Deployed¶
- Base Tables: Raw data from sources
- Semantic Models: Joined and transformed data
- Metric Tables: Pre-calculated aggregations
- Materialized Views: Optimized query performance
Deployment Configuration¶
StarRocks Connection¶
# config/prod.toml
[starrocks]
host = "prod-starrocks.example.com"
port = 9030
username = "seeknal_user"
password = "${STARROCKS_PASSWORD}"
database = "analytics_prod"
Materialization Strategy¶
semantic_model:
name: ecommerce_semantic_model
materialization:
type: materialized_view
refresh_strategy: manual # or scheduled
schedule: "0 2 * * *" # 2 AM daily
Refresh Strategies¶
Manual Refresh¶
Scheduled Refresh¶
materialization:
type: materialized_view
refresh_strategy: scheduled
schedule: "0 2 * * *" # Cron schedule
Incremental Refresh¶
Validation¶
Post-Deployment Validation¶
Checks: - View creation success - Row counts match expectations - Query performance acceptable - Access controls working
Manual Validation¶
-- Test deployed semantic model
SELECT region, total_revenue
FROM ecommerce_semantic_model_mv
GROUP BY region;
Access Control¶
Granting Permissions¶
-- Grant read access to BI users
GRANT SELECT ON ecommerce_semantic_model_mv TO bi_user;
GRANT SELECT ON ecommerce_metrics_mv TO bi_user;
Row-Level Security¶
Troubleshooting¶
Deployment Failures¶
Issue: Deployment fails with connection error.
Solution: Check StarRocks connection configuration.
Issue: View creation fails due to invalid SQL.
Solution: Test semantic model locally first.
Performance Issues¶
Issue: Queries are slow after deployment.
Solutions: - Check materialization strategy - Add appropriate indexes - Review query plans
Best Practices¶
- Test locally before deploying
- Use environments (dev → staging → prod)
- Monitor performance after deployment
- Version changes with Git
- Document refresh schedules
Related Topics¶
- Semantic Models - Defining models
- Metrics - Creating metrics
- Querying - Query patterns
Next: Learn about Querying or return to Semantic Layer Overview