You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quickwit stores its indexes's file on Amazon S3. In a single-server deployment, this can also be your local disk. We plan to support other cloud storage, as well as HDFS.
18
+
19
+
### Metastore
20
+
21
+
Quickwit gathers index metadata into a metastore to make them available across the cluster. Indexers push index data on the index storage and publish metadata to the metastore.
22
+
23
+
In a clustered deployment, the metastore is typically a traditional RDBMS like PostgreSQL which we only support today. In a single-server deployment, it’s also possible to rely on a local file or on Amazon S3.
19
24
20
-
</div>
25
+
### Distributed message queues
21
26
22
-
## The index
27
+
Quickwit indexers connect directly to external message queues like Kafka and guarantee the exactly-once semantics. If you need support for other distributed queues, please vote for yours [here](https://github.com/quickwit-inc/quickwit/issues/1000).
23
28
24
-
A quickwit index stores documents and makes it possible to query them efficiently.
25
-
The index organizes documents into a collection of smaller independent indexes called splits. Behind the scenes, a split is just a [tantivy index](https://github.com/tantivy-search/tantivy/blob/main/ARCHITECTURE.md#index-and-segments) with a custom index format.
29
+
## Architecture diagram
26
30
27
-
You have total control over how document fields are stored and indexed, thanks to the `Index config`.
31
+
The following diagram shows a Quickwit cluster with searchers and indexers that receives queries by the API and messages from a Kafka topic.
A document is a collection of fields and associated values. Fields can be stored in different data structures:
32
-
- an inverted index, which enables fast full-text search;
33
-
- a column-oriented storage called `fast field`, which is the equivalent of `DocValues` in Lucene. Fast fields are required for computing aggregates over documents matching a query. They also allow some advanced types of filtering;
34
-
- a row-store, called the `doc store` making it possible to retrieve the content of matching documents.
39
+
A Quickwit index stores documents and makes it possible to query them efficiently. The index organizes documents into a collection of smaller independent indexes called **splits**.
35
40
36
-
The index config controls how to map JSON objects to Quickwit documents and, for each field, defines whether it should be stored, indexed, or encoded as a fast field.
37
-
You can define one with a `JSON file`, [see docs](../reference/index-config.md).
41
+
A document is a collection of fields. Fields can be stored in different data structures:
42
+
43
+
- an inverted index, which enables fast full-text search.
44
+
- a columnar storage called `fast field`. It is the equivalent of doc values in [Lucene]([https://lucene.apache.org/](https://lucene.apache.org/)). Fast fields are required to compute aggregates over the documents matching a query. They can also allow some advanced types of filtering.
45
+
- a row-storage called the doc store. It makes it possible to get the content of the matching documents.
46
+
47
+
You can configure your index to control how to map your JSON object to a Quickwit document and, for each field, define whether it should be stored, indexed, or be a fast field. [Learn how to configure your index](../reference/index-config.pd)
38
48
39
49
### Splits
40
50
41
-
A split is a small piece of an index identified by a UUID. For each split, Quickwit creates a `hotcache`file along with the index files. This hotcache enables the search nodes to open a split in less than 60ms, even on high latency storage.
51
+
A split is a small piece of an index identified by a UUID. For each split, Quickwit adds up a `hotcache`file along with index files. This **hotcache** is what makes it possible for Searchers to open a split in less than 60ms, even on high latency storage.
42
52
43
-
The quickwit index is aware of its splits by keeping splits metadata, notably:
44
-
- the split state, which indicates whether the split is ready for search:
45
-
- the min/max time range computed on the timestamp field if present.
53
+
The Quickwit index is aware of its splits by keeping splits metadata, notably:
46
54
47
-
This timestamp metadata can be handy at query time. If the user specifies a time range filter in their query, Quickwit will use it to **prune irrelevant splits**.
55
+
- the split state which indicates if the split is ready for search
56
+
- the min/max time range computed on the timestamp field if present.
48
57
49
-
Index metadata needs to be accessible by every instance of the cluster. This is made possible thanks to the `metastore`.
58
+
This timestamp metadata can be handy at query time. If the user specifies a time range filter to their query, Quickwit will use it to **prune irrelevant splits**.
50
59
60
+
Index metadata needs to be accessible by every instance of the cluster. This is made possible thanks to the `metastore`.
51
61
52
-
##The metastore
62
+
### Metastore
53
63
54
64
Quickwit gathers index metadata into a metastore to make them available across the cluster.
55
65
56
66
For a given query on a given index, a search node will ask the metastore for the index metadata and then use it to do the query planning and finally execute the plan.
57
67
58
-
Currently, the only implementation of the `metastore` is a JSON file based store: it writes a `quickwit.json` on disk or in an Amazon S3 bucket. We plan on supporting other backends such as Postgresql and other popular databases soon.
59
-
68
+
Currently, Quickwit supports metastore backed by Postgresql and AWS S3 bucket. For a test/local deployment, you can also use a file backed metastore.
60
69
61
-
##The search cluster
70
+
### Distributed search
62
71
63
72
Quickwit's search cluster has the following characteristics:
73
+
64
74
- It is composed of stateless nodes: any node can answer any query about any splits.
65
75
- A node can distribute search workload to other nodes.
66
76
- Cluster membership is based on the SWIM gossip protocol.
67
77
- Load-balancing is made with rendezvous hashing to allow for efficient caching.
68
78
69
79
This design provides high availability while keeping the architecture simple.
70
80
71
-
### Stateless nodes
81
+
**Workload distribution: root and leaf nodes**
82
+
83
+
Any search node can handle any search request. A node that receives a query will act as the root node for the span of the request. It will then process it in 3 steps:
84
+
85
+
- Get the index metadata from the metastore and identify the splits relevant to the query.
86
+
- Distributes the split workload among the nodes of the cluster. These nodes are assuming the role of leaf nodes.
87
+
- Returns aggregated results.
88
+
89
+
**Stateless nodes**
72
90
73
91
Quickwit cluster distributes search workloads while keeping nodes stateless.
74
92
75
93
Thanks to the hotcache, opening a split on Amazon S3 only takes 60ms. It makes it possible to remain totally stateless: a node does not need to know anything about the indexes. Adding or removing nodes takes seconds and does not require moving data around.
76
94
77
-
### Workload distribution: root and leaf nodes
78
-
79
-
Any search node can handle any search request. A node that receives a query will acts as the root node for the span of the request. It will then process it in 3 steps:
80
-
- Get the index metadata from the metastore and identify the splits relevant for the query.
81
-
- Distributes the split workload among the nodes of the cluster. These nodes are assuming the role of leaf nodes.
82
-
- Returns aggregated results.
95
+
**Cluster discovery**
83
96
84
-
### Cluster discovery
97
+
Quickwit uses a gossip protocol to manage membership and broadcast messages to the cluster provided by [artillery project](https://github.com/bastion-rs/artillery/). The gossip protocol is based on [SWIM: Scalable Weakly-consistent Infection-style Process Group Membership Protocol]([https://www.cs.cornell.edu/projects/Quicksilver/public_pdfs/SWIM.pdf](https://www.cs.cornell.edu/projects/Quicksilver/public_pdfs/SWIM.pdf)) with a few minor adaptations.
85
98
86
-
Quickwit uses a gossip protocol to manage membership and broadcast messages to the cluster provided by [artillery project](https://github.com/bastion-rs/artillery/). The gossip protocol is based on "SWIM: Scalable Weakly-consistent Infection-style Process Group Membership Protocol" with a few minor adaptations.
99
+
**Rendezvous hashing**
87
100
101
+
The root node uses [Rendezvous hashing](https://en.wikipedia.org/wiki/Rendezvous_hashing) to distribute the workload among leaf nodes. Rendez-vous hashing makes it possible to define a node/split affinity function with excellent stability properties when a node joins or leaves the cluster. This trick unlocks efficient caching.
88
102
89
-
### Rendezvous hashing
103
+
### Indexing
90
104
91
-
The root node uses [Rendezvous hashing](https://en.wikipedia.org/wiki/Rendezvous_hashing) to distribute the workload among leaf nodes. Rendez-vous hashing makes it possible to define a node/split affinity function with excellent stability properties when a node joins or leaves the cluster. This trick unlocks efficient caching. In Quickwit v0.1, however, caching is limited to the hotcache files.
0 commit comments