跳转到主要内容
KWDB/SampleDB example project

SampleDB: Quickly validate KWDB capabilities

You can directly run examples for smart meters, multi-model queries, window functions, and aggregate functions to quickly validate KWDB modeling and query capabilities for AIoT scenarios.

Clone repository
git clone https://github.com/KWDB/SampleDB.git
sampledb-quickstart
Quick Start
Built-in Agent Skill guides you through validation with prompts
Or run directory scripts directly to quickly try SampleDB examples
Suggested prompt
Help me try SampleDB in the current environment and explain what each step is doing.

Four runnable examples

Each example provides scripts for data generation, database and table creation, import, and queries. If KWDB is already deployed in a container, you can start right away.

Start with the smart meter or multi-model query example, then move on to window functions and aggregate functions as needed.

AIoT data modeling

Smart meter model

Organizes relational rdb and time-series tsdb data for a smart meter workload, covering power consumption ranking, faulty meters, alarm detection, load statistics, and recent 24-hour trend queries.

Relational + time-series analysis

Multi-model queries

Combines relational and time-series data in one query, showing multi-model statistics, cost estimation fusion, aggregation pushdown, and high-speed multi-model join operators.

Grouped window queries

Window functions

Covers COUNT_WINDOW, EVENT_WINDOW, SESSION_WINDOW, STATE_WINDOW, and TIME_WINDOW models for validating time-series event boundaries.

Time-series aggregate operators

Aggregate functions

Covers common aggregate models including COUNT, AVG, SUM, MIN, MAX, STDDEV, FIRST, LAST, TWA, and TIME_BUCKET.

Smart Meter Web - Smart meter data visualization interface
Source: smart-meter-web example from KWDB/SampleDB

Core Features

  • Visualize smart meter data through an interactive dashboard
  • Query meter information using SQL query interface
  • Manage meter readings and analytics data
  • Support Docker containerization with multi-architecture compatibility

Smart Meter Data Management & Visualization Demo

Smart Meter Web is a demonstration system for smart meter data management and visualization based on KWDB's multimodal database, showcasing practical applications of KWDB in utility metering scenarios.

Docker Quick Start

Launch the smart meter demo with Docker in one command:

docker run -d --name smart-meter -p 3001:3001 kwdb/smart-meter:latest

Visit http://localhost:3001 after startup to experience it

KWDB provides multiple container image registries

  • Docker Hub: kwdb/smart-meter
  • 阿里云: registry.cn-hangzhou.aliyuncs.com/kwdb/smart-meter
  • GitHub: ghcr.io/kwdb/smart-meter