Aprelius logo
uptime: 00:00:00
maciej@aprelius ~ $ GDK_SCALE=1.5 xdg-open ~/design/water-metering.drawio

System Design

Just some exploration architecture for an event-driven water metering platform: from device telemetry and canonical readings to consumption, billing, alerts, and operational delivery.

Event-Driven Water Metering System

MQTT and NB-IoT devices reach a Go ingestion gateway through a shared load balancer and an EMQX broker. The gateway publishes raw telemetry to RabbitMQ and archives every payload to MongoDB, where Java processors validate, compute consumption and score anomalies before emitting business events to Kafka. Go services persist meter series to TimescaleDB and publish operational events to a second, topic-routed RabbitMQ bus feeding the notifier, dashboard and worker services. PostgreSQL holds device metadata and processing rules. A Prometheus/Grafana/OpenTelemetry stack observes every service, bus and datastore.IoTACCESSINGESTIONRAW BUSPROCESSINGDOMAIN EVENTSSERVICESOPERATIONSdevice metadataprocessing rulesMQTT Devicesmart meter · cellularNB-IoT Gatewayconcentrator · batchedLoad Balancerl4 passthroughl7 tls · routingMQTT Brokerdevice sessionsQoSIngestion Gatewayauth · normalizevalidateRabbitMQraw telemetryfanout exchangeRaw Archivefull backuprare readsMetering Processormeter corrections · eventsreading intervalsAnomaly Processorsliding windowsanomaly scoringConsumption Processordeltasbilling aggregationsKafkabusiness eventsreplayMetering Servicereadings APIBilling ServiceconsumptionaggregationsAlert Servicealerts · casesTimescaleDBmeter seriesaggregationsRabbitMQservice bustopic exchangeNotifieremail · sms · pushLive Dashboardrealtime · websocketsWorker Servicesasync jobsAdmin Paneloperator UIConfig Servicedevice provisioningControl Plane DBdevice metadataprocessing rulesPrometheusGrafanaOpenTelemetryObservabilitymetrics · logs · traces — every service, bus & datastoretelemetry flowdomain eventsstorage writescommands · jobscontrol planearchive · replay
GoJavaHAProxyEMQXRabbitMQKafkaTimescaleDBPostgreSQLDockerKubernetes