Last9 Last9

Jul 10th, ‘23 / 12 min read

Prometheus vs. VictoriaMetrics (VM)

Comparing Prometheus vs. VictoriaMetrics (VM) - Scalability, Performance, Integrations

Prometheus vs. VictoriaMetrics (VM)

There are a lot of time series databases, such as Prometheus, M3DB, TimescaleDB, OpenTSDB, InfluxDB, and so on.

Prometheus and VictoriaMetrics are open-source time-series databases that provide robust solutions for monitoring and alerting in complex IT environments. However, they are designed differently and offer unique features that can affect their performance, scalability, and ease of use for monitoring workloads.

This article aims to analyze the differences between Prometheus and VictoriaMetrics, thus providing insight for users seeking the most suitable solution for their specific needs as a monitoring solution and observability or troubleshooting their systems.

Prometheus

Prometheus, originally a project at SoundCloud, is a powerful monitoring and alerting toolkit designed for time-series data in a multi-dimensional environment. It's gained significant popularity within the SRE and DevOps community due to its:

  • Native support for multidimensional data collection
  • Efficient querying capabilities
  • Strong alert generation features

Prometheus is now maintained under the Cloud Native Computing Foundation (CNCF). Its key components, such as the Prometheus server, client libraries, and Alertmanager, are all available through the Prometheus GitHub organization. You can explore the main repository here: Prometheus GitHub.

💡
Know more about What is Prometheus?

VictoriaMetrics

VictoriaMetrics is a high-performance, cost-effective, and scalable time-series database that excels as long-term remote storage for Prometheus. It offers:

  • Superior data compression
  • High-speed data ingestion

These features make it a strong alternative for large-scale monitoring needs. You can access the VictoriaMetrics source code here: VictoriaMetrics GitHub.

Both Prometheus and VictoriaMetrics have their source code, docs, issues, pull requests, and tutorials available on their respective GitHub repositories. These are excellent resources for getting started with Docker, contributing to the projects, or troubleshooting issues.

Comparing Performance

The data ingestion and querying rates performance between VictoriaMetrics vs. Prometheus are based on a benchmark test using node_exporter metrics.

The memory and disk space usage figures are for a single Prometheus or VictoriaMetrics server.

Comparison Prometheus VictoriaMetrics
Data Collection Pull based Pull and Push based
Data ingestion Up to 240,000 samples per second Up to 360,000 samples per second
Data querying Up to 80,000 queries per second Up to 100,000 queries per second
Memory usage Up to 14GB of RAM Up to 4.3GB of RAM
Data compression Uses LZF compression Uses Snappy compression
Disk write frequency Writes data to disk more often Writes data to disk less often
Disk space usage Requires more disk space Requires less disk space
Query language PromQL MetricsQL (backward-compatible with PromQL)
💡
For a deeper look into Prometheus metrics and how they work, check out our detailed guide on Prometheus Metrics Types.

Comparing Scalability and Integrations

Architecture and Scalability

Prometheus uses a pull-based model to gather metrics, meaning it fetches data from monitored systems. This setup allows Prometheus to handle millions of active time series and simplifies the deployment of monitored services.

However, managing large, dynamic environments can be challenging because Prometheus instances need to be aware of the specific targets they need to pull from.

VictoriaMetrics, on the other hand, supports both pull and push models. This gives it flexibility and scalability, particularly in high-data-volume and complex networking scenarios. Key features include:

  • Support for both pull and push models
  • High-volume data handling
  • Native clustering for long-term storage and large-scale deployments
Prometheus and VictoriaMetrics are built with a component-based architecture, enabling flexible deployments and allowing each component to be independently developed, tested, and deployed.

Prometheus Architecture

Source Credits: https://prometheus.io/docs/introduction/overview/
Source Credits: https://prometheus.io/docs/introduction/overview/

Prometheus is built with a pluggable architecture that consists of several key components, which include:

  • Prometheus Server: The heart of the system, the Prometheus server is responsible for scraping and storing time series data.
  • Client Libraries: These libraries provide metrics from application code. Prometheus provides client libraries for several languages, including Go, Java, Python, and more.
  • Exporters: These HTTP services expose metrics in a format Prometheus can ingest. Exporters are available for third-party systems such as HAProxy, MySQL, or systems like Linux system statistics.
  • Pushgateway: For services that cannot be scraped (e.g., short-lived jobs), Prometheus provides the Pushgateway. It allows ephemeral and batch jobs to expose their metrics to Prometheus.
  • Alertmanager: This component manages alerts, de-duplicates, and groups and sends notifications via email, PagerDuty, or OpsGenie. It also takes care of silencing and inhibition of alerts.
  • PromQL: This is Prometheus's built-in flexible query language for data exploration and dashboarding, different from SQL.
  • Service Discovery: Prometheus supports various service discovery mechanisms that help it find the targets it should scrape.

VictoriaMetrics Architecture

Source Credits: docs.victoriametrics.com
Source Credits: docs.victoriametrics.com

VictoriaMetrics, while maintaining a simpler architecture, also includes several core components:

  • VictoriaMetrics Single-Node: This is the basic building block of VictoriaMetrics. It includes the time-series database and the HTTP server for ingesting and querying data.
  • VictoriaMetrics Cluster: Designed for large-scale deployments, the cluster version of VictoriaMetrics includes additional components such as the VMSelect, VMInsert, and VMStorage nodes for query execution, data ingestion, and long-term storage, respectively.
  • vmagent: Vmagent is a tiny yet powerful data scraper that can pull data from various sources and send it to VictoriaMetrics or any other remote storage that supports the InfluxDB or Prometheus remote write protocol.
  • vmalert: It evaluates alerting and recording rules against VictoriaMetrics or any other compatible TSDB.
  • vmctl: This CLI tool migrates data from different TSDBs to VictoriaMetrics.
  • vmstorage: The Storage backend for VictoriaMetrics.
  • vmui: The UI layer that comes out of the box with VictoriaMetrics.
💡
For tips and strategies on scaling Prometheus, take a look at our comprehensive guide on Scaling Prometheus: Tips, Tricks, and Proven Strategies.

Data Compression and Storage Efficiency

Prometheus has an efficient storage system but falls short compared to VictoriaMetrics when it comes to long-term data storage backends and retrieval efficiency. Other alternatives, like Last9, Thanos, and Cortex, also offer solutions for long-term data retention.

VictoriaMetrics, however, stands out with its superior data compression capabilities. Key benefits include:

  • More effective data compression: VictoriaMetrics uses a highly efficient compression algorithm, reducing storage requirements significantly.
  • Up to 10x more compression: It claims up to 10 times better data compression than Prometheus, making it ideal for long-term data retention and cost optimization.

This makes VictoriaMetrics a strong choice for users focused on optimizing storage costs and handling large-scale data.

💡
Last9 - a managed time series data warehouse that supports automatic data tiering, superior to Prometheus and VictoriaMetrics.

Both Prometheus and VictoriaMetrics use a combination of in-memory data handling and disk storage to manage time-series data:

Prometheus

1. In-Memory: Prometheus utilizes in-memory storage to access recent time-series data immediately. This segment of the database is known as the "head block."

2. Disk Storage: After reaching a certain age or size, data in the head block is moved to disk in a procedure known as checkpointingreal-time. This database consists of "persistent blocks" intended for longer-term storage.

Prometheus is optimized for real-time monitoring with this memory and disk storage combination. However, it isn't designed for extensive long-term storage. Additional tools like Levitate, Thanos, or Cortex are usually incorporated into the system.

VictoriaMetrics:

1. In-Memory: Similar to Prometheus, VictoriaMetrics uses in-memory storage to buffer incoming data before it's written to disk. This approach helps optimize write performance. It also caches frequently accessed data for faster retrieval.

2. Disk Storage: The bulk of the data in VictoriaMetrics is stored on disk. The system uses a space-efficient storage format that allows for significant data compression.

💡
Last9 is fully compatible with open standards such as OpenMetrics, PromQL, and OpenTelemetry.

Query Language

Prometheus uses PromQL (Prometheus Query Language), a powerful tool for selecting and aggregating time-series data in real time. PromQL offers developers a high level of flexibility when working with metrics. With it, users can:

  • Filter and aggregate metrics
  • Calculate rates, ratios, averages, and percentiles
  • Predict trends

Once you get the hang of it, PromQL becomes an expressive language that allows users to craft complex queries, helping them extract valuable insights from their metrics.

VictoriaMetrics is backward compatible with PromQL, meaning it can run any valid PromQL query. But it takes things a step further with an extension called MetricsQL.

MetricsQL enhances PromQL by introducing:

  • New functions and operators
  • Syntactic sugar for easier queries

This extension simplifies and improves the user experience, especially when dealing with complex queries and aggregations, making it even more powerful for advanced use cases.

Here are the primary differences between the two:

💡
For a handy reference on PromQL queries, check out our PromQL Cheat Sheet.

PromQL

  • Developed by the Prometheus project, PromQL is known for its expressiveness, enabling users to filter and aggregate multidimensional time series data.
  • PromQL supports various functions and operators, allowing users to calculate rates, ratios, averages, and quantiles and make predictions on their time-series data.
  • However, PromQL can be complex to learn and use, especially for complicated queries, and its syntax can be cumbersome for some users.

MetricsQL

  • MetricsQL is an extension of PromQL developed by VictoriaMetrics, designed to enhance querying capabilities and provide a more user-friendly approach to handling time-series data.
  • It is fully compatible with PromQL, so any query valid in PromQL is also valid in MetricsSQL.
  • MetricsQL introduces new functions, improvements, and syntactic sugar to simplify the query process. For example, it provides ways to work with multiple range vectors, work with string values, and aggregate data.
  • While it retains the power and expressiveness of PromQL, MetricsQL strives to make complex queries easier to write and understand.

Ingestion Rate

Some differences in their design can affect the ingestion rate:

Prometheus:

  • Prometheus is designed to pull metrics from monitored targets at regular intervals. The frequency of these scrapes can be adjusted to control the ingestion rate.
  • The actual rate at which Prometheus can ingest data can depend on many factors, including the performance of the hardware it's running on, the complexity of the metrics being scraped, and the efficiency of the storage layer.
  • If Prometheus cannot keep up with the volume of incoming data, it can drop samples or experience increased latency.

VictoriaMetrics:

  • VictoriaMetrics has been designed to be more resource-efficient than Prometheus. It claims to ingest data more efficiently, with less CPU usage, RAM, and disk space for the same volume of data.
  • This efficiency can enable VictoriaMetrics to ingest data faster than Prometheus on the same hardware.
  • Regarding design, VictoriaMetrics can ingest data through pull (like Prometheus) and push models. The push model is beneficial for high cardinality data and ingestion rates.
💡
To understand how to ensure high availability in Prometheus, check out our guide on High Availability in Prometheus.

High Availability and Reliability

Prometheus does not inherently support clustering, which means it does not provide native high availability. High availability can be achieved by running duplicate instances, but this process requires manual effort and coordination.

In contrast, VictoriaMetrics was designed with high availability in mind. It uses replication and clustering to ensure data is not lost in case of an instance failure, making it a more reliable option for critical applications.

💡
Last9 commits to a 99.9% write availability and a 99.5% read availability and provides a managed offering as time series data warehouse. Get started today.

API

Prometheus and VictoriaMetrics expose their functionalities through HTTP-based APIs, allowing clients to interact with them programmatically.

Prometheus API

Prometheus uses its HTTP API for a variety of tasks, including but not limited to:

  • Querying: Prometheus provides the PromQL querying language, which users can use to extract metric data via the HTTP API. This makes it easy to integrate Prometheus with other services or scripts and consume the time series data in JSON format.
  • Metadata: The API endpoint provides access to metadata about the series and labels in the Prometheus server.
  • Administration: Certain administrative tasks, such as deleting series, snapshots, etc., can also be performed through the API.

VictoriaMetrics API

VictoriaMetrics provides a comprehensive HTTP API that is divided into several parts based on the functionality:

  • Metrics API for Prometheus: This API is compatible with Prometheus's HTTP API, meaning you can use VictoriaMetrics as a drop-in replacement for Prometheus. This includes APIs for reading and writing metrics data.
  • InfluxDB API: VictoriaMetrics also provides an API compatible with InfluxDB's write and query APIs. This makes it easy to switch from InfluxDB to VictoriaMetrics.
  • Graphite API: VictoriaMetrics also provides a compatibility layer for Graphite's API.
  • MetricsQL and PromQL APIs: These are used for querying metrics data stored in VictoriaMetrics. MetricsQL is a VictoriaMetrics-specific extension of PromQL and provides additional functionality unavailable in PromQL.
  • Miscellaneous APIs: VictoriaMetrics also provides several other APIs, for example, to export data, get internal metrics, delete metrics data, etc.

Pricing Models

Prometheus

  • Open-source and free: Prometheus is entirely free to use in its open-source version, making it a cost-effective solution, especially for smaller organizations or projects.
  • Additional costs: While Prometheus itself doesn't have licensing fees, there may be hidden costs associated with infrastructure, storage, and scaling. As your monitoring needs grow, managing the storage and high availability requirements can incur extra expenses.

VictoriaMetrics

  • Open-source with a commercial option: Like Prometheus, VictoriaMetrics offers an open-source version at no cost. However, for larger deployments, advanced features, and enterprise-level support, there is a paid version available. This paid version offers additional capabilities to handle large-scale environments efficiently.
  • Cost-effective storage: VictoriaMetrics stands out for its data compression, which can significantly reduce storage costs. This is particularly beneficial for long-term data retention, as the compression helps lower the overall infrastructure costs compared to other solutions.

In short, Prometheus is a great fit if you need a free and flexible solution, but you might face hidden costs with scaling. VictoriaMetrics, while free in its open-source form, offers cost benefits in the long term, especially for large-scale, high-performance data storage.

💡
To learn how Replit reduced monitoring costs and moved away from Thanos, check out our blog on How We Reduced Monitoring Costs and Deprecated Thanos for Replit.

Integration with Grafana

Visualizing data in Grafana for both Prometheus and VictoriaMetrics is quite similar, thanks to Grafana's flexible data source support.

Here's an essential guide on how to visualize data from both of these systems:

For Prometheus:

  1. Install and run Grafana:
    • Download Grafana from the official website.
    • Once installed, access the Grafana UI via your web browser.
  2. Add Prometheus as a data source:
    • From the Grafana home screen, click the Configuration (gear icon) in the side menu.
    • Select Data Sources > Add data source.
    • Choose Prometheus from the list of options.
    • In the HTTP section, set the URL to your Prometheus server (e.g., http://localhost:9090).
    • Click Save & Test to confirm the connection.
  3. Create a dashboard:
    • On the Grafana homepage, select Create > Dashboard from the side menu.
    • Click Add Query to enter your PromQL queries and visualize the results.

For VictoriaMetrics:

The process is very similar to Prometheus, with only a few adjustments:

  1. Install and run Grafana:
    • Follow the same steps as above to install and access Grafana.
  2. Add VictoriaMetrics as a data source:
    • From the Grafana home screen, click the Configuration (gear icon) in the side menu.
    • Select Data Sources > Add data source.
    • Choose Prometheus from the list of options.
    • In the HTTP section, set the URL to your VictoriaMetrics server (e.g., http://localhost:8428).
    • Click Save & Test to verify the connection.
  3. Create a dashboard:
    • On the Grafana homepage, select Create > Dashboard from the side menu.
    • Click Add Query to enter your MetricsQL or PromQL queries and visualize the results.

Visualization Options in Grafana:

  • Grafana supports various visualizations such as graphs, tables, heatmaps, and single stats.
  • Once you've connected your data source (Prometheus or VictoriaMetrics), you can easily create and customize visualizations to meet your needs.
💡
For a complete guide on monitoring Kubernetes with Prometheus and Grafana, check out our article on Kubernetes Monitoring with Prometheus and Grafana.

Integration with Kubernetes

Prometheus and VictoriaMetrics can monitor Kubernetes (K8s) clusters and deploy within a Kubernetes environment in cloud providers such as AWS and GCP.

Prometheus

Prometheus, a part of the Cloud Native Computing Foundation (CNCF), just like Kubernetes, has robust support for monitoring Kubernetes environments.

1. Monitoring: Prometheus natively supports Kubernetes service discovery, meaning it can automatically discover and scrape metrics from your services, nodes, and pods.

2. Deployment: Prometheus can be deployed on Kubernetes using the stable Prometheus Helm chart or the Prometheus Operator. The Prometheus Operator simplifies the deployment and configs of Prometheus, Alertmanager, and related monitoring components. It also provides Kubernetes custom resources to deploy and manage Prometheus and Alertmanager instances.

VictoriaMetrics

VictoriaMetrics also offers extensive support for Kubernetes monitoring and deployment.

1. Monitoring: VictoriaMetrics can scrape Prometheus metrics and use the same service discovery configs as Prometheus to discover and scrape Kubernetes services. There's also vmagent, a VictoriaMetrics component designed to fetch Prometheus metrics from various data sources, including Kubernetes.

2. Deployment: VictoriaMetrics can be deployed in Kubernetes using its Helm charts.

Last9’s Telemetry Warehouse now supports Logs and Traces
Last9’s Telemetry Warehouse now supports Logs and Traces

Use Cases and Applications

Prometheus

  • Infrastructure monitoring: Prometheus is great for keeping an eye on your infrastructure, whether it’s servers, virtual machines, or network devices. It collects metrics and helps you spot any performance issues.
  • Application performance monitoring: If you need to track how well your apps are performing—like monitoring response times, error rates, or request throughput—Prometheus does the job. It’s super helpful for debugging and improving app reliability.
  • Cloud-native environments: When you’re dealing with cloud-native setups, especially in Kubernetes, Prometheus is a go-to tool. It integrates easily with containerized apps and helps you manage everything in a dynamic environment.

VictoriaMetrics

  • Big-scale infrastructure monitoring: VictoriaMetrics is built to handle a huge volume of data. If your environment is large, with tons of time-series data, it’s a solid choice for monitoring your systems and ensuring everything runs smoothly.
  • Long-term data storage: If you need to keep data around for a long time—think months or even years—VictoriaMetrics stands out. It compresses data well, so you don’t have to worry about storage costs as much.
  • IoT data management: For managing IoT data, where you have thousands of devices sending data at once, VictoriaMetrics can easily handle the high influx of metrics and store them efficiently for later analysis.

In short, Prometheus is perfect for everyday monitoring in smaller to mid-sized environments, while VictoriaMetrics is your best bet for handling large-scale data and long-term storage needs. Both are solid choices—just depends on how big your setup is!

💡
Compare different time series databases at one place and understand their differences.

Conclusion

Choosing between Prometheus and VictoriaMetrics depends on your needs:

  • Prometheus excels with powerful querying and CNCF integrations, ideal for environments that prioritize these features.
  • VictoriaMetrics is better for scalability, data compression, and high availability, making it a top choice for large-scale, long-term storage.

Assess your monitoring requirements before deciding.

💡
The Last9 promise — We will reduce your TCO by about 50%. Our managed time series database data warehouse comes with streaming aggregation, data tiering, and the ability to manage high cardinality. If this sounds interesting, talk to us.

Contents


Newsletter

Stay updated on the latest from Last9.

Authors
Last9

Last9

Last9 helps businesses gain insights into the Rube Goldberg of micro-services. Levitate - our managed time series data warehouse is built for scale, high cardinality, and long-term retention.

X