-
Notifications
You must be signed in to change notification settings - Fork 0
Operations Startup
synthaicode edited this page Oct 25, 2025
·
3 revisions
Purpose: phased steps to safely bring up a Ksql.Linq app. Covers Schema Registry registration and initial DDL; monitoring/tuning live elsewhere.
- Phase 0: register models (
Set<T>()registration, type definitions) - Phase 1: register schemas (Schema Registry)
- Register Avro key/value schemas for all entities
- Mind compatibility and type mappings (e.g.,
decimal)
- Phase 2: base DDL (KSQL)
- Create Kafka topics (
num.partitions/replication.factor) - Run
CREATE STREAM/TABLEin ksqlDB
- Create Kafka topics (
- Phase 3: execution DDL (KSQL)
- Create
CREATE TABLE AS SELECT(CTAS) orCREATE STREAM+INSERT INTO - Verify RUNNING state and topic flow/records
- Create
- Note (rows_last init)
- If
<base>_1s_rowsexists, ensure<base>_1s_rows_lastvia create‑if‑missing
- If
Verification commands
-
SHOW STREAMS;/SHOW TABLES; DESCRIBE <name>;SELECT * FROM <name> EMIT CHANGES LIMIT 1;
- Explicitly register monitored TABLEs; verify Kafka/ksqlDB connectivity/permissions and base DDL
- Perform initial “fill” and create rows_last if needed
- If SR is out‑of‑band, have the Context skip registration
public class AppContext : KsqlContext
{
protected override bool SkipSchemaRegistration => true; // skip SR registration and related DDL
public AppContext(IConfiguration cfg, ILoggerFactory? lf = null) : base(cfg, lf) { }
}- Additional options
var options = new KsqlContextOptions()
.UseSchemaRegistry(new SchemaRegistryConfig { Url = "http://unused" })
.ConfigureValidation(autoRegister: false, failOnErrors: false);- Generate
CREATE STREAM/TABLEfor a simple entity
var gen = new Ksql.Linq.Query.Pipeline.DDLQueryGenerator();
var model = ctx.ModelRegistry.Get(typeof(BasicMessage));
var provider = new EntityModelDdlAdapter(model);
var ddl = model.StreamTableType == StreamTableType.Table
? gen.GenerateCreateTable(provider)
: gen.GenerateCreateStream(provider);
Console.WriteLine(ddl);- Generate execution DDL (CTAS/INSERT)
var ddl2 = KsqlCreateStatementBuilder.Build(
model.GetTopicName(), model.QueryModel!, model.KeySchemaFullName, model.ValueSchemaFullName,
t => ctx.ResolveTopicName(t));
Console.WriteLine(ddl2);Notes
- When skipping SR, ensure referenced subjects exist and DDL aligns before execution
- Keep SR/client initialization minimal when skipping (e.g., dummy URL)
- Observation/monitoring: Observation-Events
- Lag monitoring/tuning: Lag-Monitoring-and-Tuning
- Initial ops reference: Observation-Events
Guide
Core Concepts
Tumbling
- Tumbling-Overview
- Tumbling-Definition
- Tumbling-Consumption
- Tumbling-Topics-Config
- Tumbling-State-Store
- Tumbling-Schedule-Last
- Tumbling-Migration
Operations
- Produce-Consume-and-DLQ
- Operations-Startup-and-Monitoring (Index)
- Operations-Startup
- Lag-Monitoring-and-Tuning
- Streamiz-Clear
- Appsettings
- Examples
Reference