{"id":50494901,"url":"https://github.com/crate/cratedb-explore","last_synced_at":"2026-06-02T06:04:09.740Z","repository":{"id":360660818,"uuid":"1251100511","full_name":"crate/cratedb-explore","owner":"crate","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-27T11:25:10.000Z","size":821,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T11:25:40.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cratedb.com/explore","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-27T08:40:41.000Z","updated_at":"2026-05-27T11:25:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/crate/cratedb-explore","commit_stats":null,"previous_names":["crate/cratedb-explore"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/crate/cratedb-explore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Fcratedb-explore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Fcratedb-explore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Fcratedb-explore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Fcratedb-explore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crate","download_url":"https://codeload.github.com/crate/cratedb-explore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Fcratedb-explore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33808704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T06:04:05.293Z","updated_at":"2026-06-02T06:04:09.734Z","avatar_url":"https://github.com/crate.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"doc/crate-logo.svg\" alt=\"CrateDB\" width=\"200\"\u003e\n\n# CrateDB Explore\n\n\u003cimg src=\"doc/screenshot1.png\" alt=\"Weather monitoring dashboard\" width=\"100%\"\u003e\n\u003cimg src=\"doc/screenshot2.png\" alt=\"Weather monitoring key indicators\" width=\"100%\"\u003e\n\nThis project accompanies the [CrateDB Explore: IoT Analytics](https://cratedb.com/explore/iot-analytics?use-case=iot) hands-on demo. That demo walks you through real-time IoT analytics using weather monitoring data — 260k timestamped readings from 80 weather stations across Germany with temperature, humidity, and pressure values. You run hourly aggregations in under a second, execute geographic SQL queries, and connect a live Grafana dashboard, all in about 30 minutes.\n\nThe load generators in this repository let you drive that same dataset with a configurable mix of geo-proximity, multi-table join, and full-text search queries over the PostgreSQL wire protocol. Each implementation produces identical workloads and reports latency percentiles via [HdrHistogram](https://github.com/HdrHistogram/HdrHistogram).\n\n## Weather Load Generators\n\n| Language | Directory | Driver |\n| -------- | --------- | ------ |\n| [Java](src_weather/main/java/README.md) | `src_weather/main/java/` | JDBC (`postgresql`) |\n| [Python](src_weather/main/python/README.md) | `src_weather/main/python/` | [psycopg2](https://www.psycopg.org/) |\n| [.NET (C#)](src_weather/main/dotnet/README.md) | `src_weather/main/dotnet/` | [Npgsql](https://www.npgsql.org/) |\n\n### Query types\n\nAll three implementations expose the same three query types, mixed via `TYPE:COUNT` arguments at the command line. Each stresses a different side of CrateDB:\n\n- **`WKT`** — geo-proximity scan. Picks a random `geo_point` + `timestamp` from a pre-loaded pool and asks for the min/max temperature within 1° of that point at that moment. Exercises spatial filtering on `geo_point`. One row out per call. Cheapest of the three; sits at the bottom of the latency chart.\n- **`REGION`** — three-table join. Picks a random federal-state name and returns every sensor inside that polygon at the most recent measurement epoch, with its nearest-town label. Exercises `WITHIN(point, polygon)` containment, a correlated `max(measurement_time)` subquery, and a join on `geo_location`. Almost always the slowest — polygon containment is O(vertices) per candidate point, the subquery scans all of `climate_data`, and the result set is dozens of rows.\n- **`FTS`** — full-text relevance ranking. Picks a random term (`cars`, `trains`, `factories`, `energy`) and runs `MATCH(economics, ?)` against `german_regions`, returning the top 3 by `_score`. Exercises the Lucene-backed full-text index. Three rows out. Fast in steady state, occasional tail spikes on cold matches.\n\nSee each implementation's `Query types` section ([Java](src_weather/main/java/README.md#query-types) / [Python](src_weather/main/python/README.md#query-types) / [.NET](src_weather/main/dotnet/README.md#query-types)) for the SQL and language-specific notes.\n\n### Latency charts\n\nAfter each run, every implementation writes a `latency_histogram.png` to its working directory — a percentile-distribution plot (50%, 90%, 99%, 99.9%, 99.99%) with one line per query type, rendered with the platform's native plotting library. The shape is the same in all three (REGION climbs into a tail plateau, WKT/FTS stay low); only the styling differs.\n\n| Java \u0026mdash; [JFreeChart](https://www.jfree.org/jfreechart/) | Python \u0026mdash; [matplotlib](https://matplotlib.org/) | .NET \u0026mdash; [ScottPlot](https://scottplot.net/) |\n| --- | --- | --- |\n| [\u003cimg src=\"doc/latency_histogram_java.png\" alt=\"Java latency chart\"\u003e](src_weather/main/java/README.md#latency-chart) | [\u003cimg src=\"doc/latency_histogram_python.png\" alt=\"Python latency chart\"\u003e](src_weather/main/python/README.md#latency-chart) | [\u003cimg src=\"doc/latency_histogram_dotnet.png\" alt=\".NET latency chart\"\u003e](src_weather/main/dotnet/README.md#latency-chart) |\n\n## KNN Search CLI\n\nInteractive search tool for CrateDB's `german_regions` table. Supports semantic search via OpenAI embeddings + `KNN_MATCH`, and BM25 fulltext search via `MATCH` — no OpenAI key needed for fulltext mode.\n\n| Language | Directory | Driver |\n| -------- | --------- | ------ |\n| [Java](src_knn_search/main/java/README.md) | `src_knn_search/main/java/` | JDBC (`postgresql`) + [Gson](https://github.com/google/gson) |\n| [Python](src_knn_search/main/python/README.md) | `src_knn_search/main/python/` | [psycopg](https://www.psycopg.org/) + [OpenAI](https://github.com/openai/openai-python) |\n| [.NET (C#)](src_knn_search/main/dotnet/README.md) | `src_knn_search/main/dotnet/` | [Npgsql](https://www.npgsql.org/) |\n\n## Data and Schema\n\nThe `sql/` directory contains the DDL and DML needed to set up the demo tables:\n\n| File | Description |\n| ---- | ----------- |\n| [`german_weather_data_ddl.sql`](sql/german_weather_data_ddl.sql) | `CREATE TABLE` statements for `climate_data`, `german_regions`, and `geo_points` |\n| [`german_weather_data_dml.sql`](sql/german_weather_data_dml.sql) | `COPY FROM` and `INSERT` statements to load reference data |\n\nThe `data/` directory contains the reference datasets:\n\n| File | Description |\n| ---- | ----------- |\n| [`geo_points.json`](data/geo_points.json) | 726 weather station locations with nearest-town mappings |\n| [`german_regions.json`](data/german_regions.json) | 16 German states with boundaries, fulltext columns, and embeddings |\n| [`export-demo_climate_data_large_v2.json`](data/export-demo_climate_data_large_v2.json) | Climate measurement readings |\n\n## MCP Search (Claude + CrateDB)\n\nA minimal Python [MCP](https://modelcontextprotocol.io) server that exposes a single `query_sql` tool over the weather dataset, so an MCP client like [Claude](https://www.anthropic.com/claude) can answer questions about the data in plain English. It is built on the official MCP Python SDK (`FastMCP`) and talks to CrateDB's HTTP `_sql` endpoint. The one non-trivial rule — using `WITHIN` to keep \"in Germany\" queries inside the country's borders — is baked into the server's instructions.\n\nSee the [MCP Search overview](src_mcp_search/README.md) for install, configuration, and how to register it with an assistant. A draft cratedb.com walkthrough lives in [`GERMAN_WEATHER_MCP.md`](src_mcp_search/GERMAN_WEATHER_MCP.md).\n\n## Grafana Dashboard\n\nThe `grafana/` directory contains a pre-built dashboard for visualizing the weather data:\n\n| File | Description |\n| ---- | ----------- |\n| [`german_weather_data.json`](grafana/german_weather_data.json) | Importable Grafana dashboard with geomap, gauge, and time-series panels. Connects to CrateDB via the PostgreSQL datasource plugin. |\n\nTo use it, add a PostgreSQL datasource in Grafana pointing at your CrateDB cluster, then import the JSON file via **Dashboards \u003e Import**.\n\n## Prerequisites\n\n- Network access to your CrateDB cluster on port 5432\n- The tables above populated in a `demo` schema (run the DDL then DML scripts)\n\nSee each implementation's README for language-specific setup and usage instructions.\n\n## License\n\nApache License 2.0. See the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrate%2Fcratedb-explore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrate%2Fcratedb-explore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrate%2Fcratedb-explore/lists"}