The database schema must accommodate the following fields:
- Stream name
- Stream creator (actor)
- Schema title
- Stream created date
- Stream updated date
- [Optional] Stream expiry date
- [Optional] Sampling unit and rate
- [Optional] Stream producer configuration
- This is a map of producer name (string) to arbitrary producer configuration
- NOTE: We can validate producer configuration before reading from/writing it to the database
- This is a map of producer name (string) to arbitrary producer configuration
- Has been reviewed by the Legal department?
- Legal reviewer (actor)
We also need to provide an estimate for read and write frequencies for the expected access patterns.
Estimates
Read frequency: Once per pageview
Write frequency: Very infrequent
Table size: 1-10 MiB
Proposed Database Schema
{ "name": "event_stream_configs", "columns": [ { "name": "escs_id", "comment": "The analytics instrumentation stream ID for referring to for updating and deleting.", "type": "integer", "options": { "unsigned": true, "notnull": true, "autoincrement": true } }, { "name": "escs_creator", "comment": "actor_id of the analytics instrumentation stream creator.", "type": "bigint", "options": { "notnull": true, "unsigned": true } }, { "name": "escs_created_at", "type": "mwtimestamp", "options": { "notnull": true } }, { "name": "escs_updated_at", "type": "mwtimestamp", "options": { "notnull": true } }, { "name": "escs_expires_at", "type": "mwtimestamp" }, { "name": "escs_name", "type": "binary", "options": { "notnull": true, "length": 255 } }, { "name": "escs_params", "comment": "Serialised stream producer configuration.", "type": "blob", "options": { "notnull": false, "length": 65535 } }, { "name": "escs_disabled", "comment": "", "type": "mwtinyint", "options": { "notnull": true, "unsigned": true, "default": 0 } }, { "name": "escs_reviewer", "comment": "actor_id of the person who last reviewed the analytics instrumentation stream configuration", "type": "bigint", "options": { "notnull": true, "unsigned": true } } ], "indexes": [ { "name": "escs_created_at", "comment": "Special:InstrumentationStreams created sort", "columns": [ "escs_created_at" ], "unique": false }, { "name": "escs_created_by", "comment": "Special:InstrumentationStreams creator sort", "columns": [ "escs_created_by", "escs_updated_at" ], "unique": false }, { "name": "escs_updated_at", "comment": "Special:InstrumentationStreams default sort", "columns": [ "escs_updated_at" ], "unique": false }, ], "pk": [ "escs_id" ] }