Motivation
When I saw this article, I thought the way Drasi's continuous query applies queries to events was similar to Elasticsearch's percolate query.
Microsoft Introduces Drasi: Open-Source System for Real-Time Event Processing and Automation
This article is the result of asking Gemini about it.
Are they same?
While both Elasticsearch's percolate query and Drasi's continuous queries deal with matching incoming data against predefined queries, there are some key differences.
Elasticsearch Percolate Query:
- Focus:
- Primarily designed for indexing queries and then matching documents against those queries. It's like asking "Which of these registered queries does this document match?"
- Mechanism:
- You register your queries in an Elasticsearch index. When you "percolate" a document, it's indexed into a temporary in-memory index and compared against the registered queries.
- Use Cases:
- Alerting, classification, and real-time analytics based on matching documents to predefined criteria.
Drasi Continuous Query:
- Focus:
- Geared towards real-time event processing and automation. It's like saying "Whenever an event happens that matches this condition, take this action."
- Mechanism:
- Continuous queries are defined as part of a Drasi pipeline. Incoming events are evaluated against these queries, and matching events trigger actions (e.g., sending notifications, updating databases, or invoking other services).
- Use Cases:
- Real-time monitoring, automated responses to events, and complex event processing in applications like IoT, fraud detection, and business process automation.
Key Differences Summarized:
Feature | Elasticsearch Percolate Query | Drasi Continuous Query |
---|---|---|
Primary Purpose | Match documents to queries | Trigger actions based on events |
Scope | Primarily within Elasticsearch | Part of a larger event processing pipeline |
Action Trigger | Matching a document | Matching an event |
Typical Use Cases | Alerting, classification | Real-time monitoring, automation |
In essence:
- Percolate queries are about finding which queries a document matches.
- Continuous queries are about taking actions when events match specific conditions.
While they share similarities in the concept of matching, their purpose and implementation within their respective systems are distinct.