# GreptimeDB — Unified Time-Series Database in Rust > GreptimeDB is an open-source, cloud-native time-series database built in Rust that handles metrics, logs, and events in a single platform. It uses a distributed architecture with SQL and PromQL support for querying time-series data at scale. ## Install Save as a script file and run: # GreptimeDB — Unified Time-Series Database in Rust ## Quick Use ```bash docker run -d -p 4000-4003:4000-4003 greptime/greptimedb:latest standalone start # Connect via MySQL protocol on port 4002 mysql -h 127.0.0.1 -P 4002 ``` ## Introduction GreptimeDB was created to unify the storage and analysis of metrics, logs, and events that traditionally require separate systems. Written in Rust for performance and safety, it offers a cloud-native distributed architecture that scales from edge devices to large clusters. ## What GreptimeDB Does - Stores metrics, logs, and events in a single time-series database - Supports SQL, PromQL, and an HTTP API for flexible querying - Ingests data via MySQL protocol, PostgreSQL protocol, gRPC, InfluxDB line protocol, and OpenTelemetry - Separates compute, storage, and metadata into independently scalable components - Compresses time-series data efficiently using columnar storage with Apache Parquet ## Architecture Overview GreptimeDB consists of three components: frontends that accept queries and writes, datanodes that store and process data, and a metasrv that manages cluster metadata and coordination. Data is organized into tables partitioned by time ranges and stored as Parquet files on local disk or object storage. The query engine compiles SQL and PromQL into a unified execution plan. ## Self-Hosting & Configuration - Run in standalone mode for development or distributed mode for production - Deploy on Kubernetes using the official GreptimeDB Operator and Helm chart - Configure object storage backends (S3, GCS, Azure Blob) for durable storage - Enable Prometheus remote write for direct metric ingestion - Set retention policies and compaction settings per table ## Key Features - Unified storage for metrics and logs eliminates the need for separate systems - PromQL compatibility enables drop-in replacement for Prometheus queries - MySQL and PostgreSQL wire protocol support for familiar tooling - Distributed architecture with elastic scaling of compute and storage - Edge-to-cloud deployment from embedded devices to large clusters ## Comparison with Similar Tools - **TimescaleDB** — PostgreSQL extension for time series; GreptimeDB is a standalone distributed system - **InfluxDB** — popular time-series DB; GreptimeDB adds SQL support and unified log handling - **VictoriaMetrics** — Prometheus-compatible metrics store; GreptimeDB also handles logs and events - **QuestDB** — fast SQL time-series DB; GreptimeDB offers distributed mode and object storage - **ClickHouse** — columnar analytics; GreptimeDB is purpose-built for time-series with PromQL support ## FAQ **Q: Can GreptimeDB replace Prometheus?** A: GreptimeDB supports Prometheus remote write and PromQL, so it can serve as a long-term storage backend while Prometheus handles scraping. **Q: What query languages does GreptimeDB support?** A: SQL, PromQL, and a Python scripting interface for custom processing. **Q: Does GreptimeDB support high availability?** A: Yes. In distributed mode, data is replicated across datanodes, and metasrv supports leader election for failover. **Q: Can it run on edge devices?** A: Yes. Standalone mode with minimal configuration can run on resource-constrained devices for local time-series collection. ## Sources - https://github.com/GreptimeTeam/greptimedb - https://docs.greptime.com --- Source: https://tokrepo.com/en/workflows/6097a6b0-3b64-11f1-9bc6-00163e2b0d79 Author: Script Depot