ccaominh commented on a change in pull request #8311: Docusaurus build 
framework + ingestion doc refresh.

 File path: docs/ingestion/
 @@ -0,0 +1,769 @@
+id: index
+title: "Ingestion"
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+## Overview
+All data in Druid is organized into _segments_, which are data files that 
generally have up to a few million rows each.
+Loading data in Druid is called _ingestion_ or _indexing_ and consists of 
reading data from a source system and creating
+segments based on that data.
+In most ingestion methods, the work of loading data is done by Druid 
MiddleManager processes. One exception is
+Hadoop-based ingestion, where this work is instead done using a Hadoop 
MapReduce job on YARN (although MiddleManager
+processes are still involved in starting and monitoring the Hadoop jobs). Once 
segments have been generated and stored
+in [deep storage](../dependencies/, they will be loaded by 
Historical processes. For more details on
+how this works under the hood, see the [Storage 
design](../design/ section of Druid's design
+## How to use this documentation
+This **page you are currently reading** provides information about universal 
Druid ingestion concepts, and about
+configurations that are common to all [ingestion methods](#ingestion-methods).
+The **individual pages for each ingestion method** provide additional 
information about concepts and configurations
+that are unique to each ingestion method.
+We recommend reading (or at least skimming) this universal page first, and 
then referring to the page for the
+ingestion method or methods that you have chosen.
+## Ingestion methods
+The table below lists Druid's most common data ingestion methods, along with 
comparisons to help you choose
+the best one for your situation. Each ingestion method supports its own set of 
source systems to pull from. For details
+about how each method works, as well as configuration properties specific to 
that method, check out its documentation
+### Streaming
+The most recommended, and most popular, method of streaming ingestion is the
+[Kafka indexing service](../development/extensions-core/ 
that reads directly from Kafka. The Kinesis
+indexing service also works well if you prefer Kinesis.
+This table compares the major available options:
+| **Method** | [Kafka](../development/extensions-core/ | 
[Kinesis](../development/extensions-core/ | 
[Tranquility]( |
+| **Supervisor type** | `kafka` | `kinesis` | N/A |
+| **How it works** | Druid reads directly from Apache Kafka. | Druid reads 
directly from Amazon Kinesis. | Tranquility, a library that ships separately 
from Druid, is used to push data into Druid. |
+| **Can ingest late data?** | Yes | Yes | No (late data is dropped based on 
the `windowPeriod` config) |
+| **Exactly-once guarantees?** | Yes | Yes | No |
+### Batch
+When doing batch loads from files, you should use one-time [tasks](, 
and you have three options: `index`
+(native batch; single-task), `index_parallel` (native batch; parallel), or 
`index_hadoop` (Hadoop-based). The following
+table compares and contrasts the three batch ingestion options.
+In general, we recommend native batch whenever it meets your needs, since the 
setup is simpler (it does not depend on
+an external Hadoop cluster). However, there are still scenarios where 
Hadoop-based batch ingestion is the right choice,
+especially due to its support for custom partitioning options and reading 
binary data formats.
+This table compares the major available options:
+| **Method** | [Native batch (simple)](native-batch.html#simple-task) | 
[Native batch (parallel)](native-batch.html#parallel-task) | 
[Hadoop-based](hadoop.html) |
+| **Task type** | `index` | `index_parallel` | `index_hadoop` |
+| **Automatically parallel?** | No. Each task is single-threaded. | Yes, if 
firehose is splittable. See [firehose documentation]( 
for details. | Yes, always. |
+| **Can append or overwrite?** | Yes, both. | Yes, both. | Overwrite only. |
+| **External dependencies** | None. | None. | Hadoop cluster (Druid submits 
Map/Reduce jobs). |
+| **Input locations** | Any [firehose]( | Any 
[firehose]( | Any Hadoop FileSystem or Druid 
datasource. |
+| **File formats** | Text file formats (CSV, TSV, JSON). Support for binary 
formats is coming in a future release. | Text file formats (CSV, TSV, JSON). 
Support for binary formats is coming in a future release. | Any Hadoop 
InputFormat. |
+| **[Rollup modes](#rollup)** | Perfect if `forceGuaranteedRollup` = true in 
the [`tuningConfig`](| Only best-effort. Support 
for perfect rollup is coming in a future release. | Always perfect. |
+| **Partitioning options** | Hash-based partitioning is supported when 
`forceGuaranteedRollup` = true in the 
[`tuningConfig`]( | None. Support for 
partitioning is coming in a future release. | Hash-based or range-based 
partitioning via [`partitionsSpec`](hadoop.html#partitioning-specification). |
+## Druid's data model
+### Datasources
+Druid data is stored in [datasources](index.html#datasources), which are 
similar to tables in a traditional RDBMS. Druid
+offers a unique data modeling system that bears similarity to both relational 
and timeseries models.
+### Primary timestamp
+Druid schemas must always include a primary timestamp. The primary timestamp 
is used for
+[partitioning and sorting](#partitioning) your data. Druid queries are able to 
rapidly identify and retrieve data
+corresponding to time ranges of the primary timestamp column. Druid is also 
able to use the primary timestamp column
+for time-based [data management operations](data-management.html) such as 
dropping time chunks, overwriting time chunks,
+and time-based retention rules.
+The primary timestamp is parsed based on the 
[`timestampSpec`](#timestampspec). In addition, the
+[`granularitySpec`](#granularityspec) controls other important operations that 
are based on the primary timestamp.
+Regardless of which input field the primary timestamp is read from, it will 
always be stored as a column named `__time`
+in your Druid datasource.
+If you have more than one timestamp column, you can store the others as
+[secondary timestamps](
+### Dimensions
+Dimensions are columns that are stored as-is and can be used for any purpose. 
You can group, filter, or apply
+aggregators to dimensions at query time in an ad-hoc manner. If you run with 
[rollup](#rollup) disabled, then the set of
+dimensions is simply treated like a set of columns to ingest, and behaves 
exactly as you would expect from a typical
+database that does not support a rollup feature.
+Dimensions are configured through the [`dimensionsSpec`](#dimensionsspec).
+### Metrics
+Metrics are columns that are stored in an aggregated form. They are most 
useful when [rollup](#rollup) is enabled.
+Specifying a metric allows you to choose an aggregation function for Druid to 
apply to each row during ingestion. This
+has two benefits:
+1. If [rollup](#rollup) is enabled, multiple rows can be collapsed into one 
row even while retaining summary
+information. In the [rollup tutorial](../tutorials/, this 
is used to collapse netflow data to a
+single row per `(minute, srcIP, dstIP)` tuple, while retaining aggregate 
information about total packet and byte counts.
+2. Some aggregators, especially approximate ones, can be computed faster at 
query time even on non-rolled-up data if
+they are partially computed at ingestion time.
+Metrics are configured through the [`metricsSpec`](#metricsspec).
+## Rollup
+### What is rollup?
+Druid can roll up data as it is ingested to minimize the amount of raw data 
that needs to be stored. Rollup is
+a form of summarization or pre-aggregation. In practice, rolling up data can 
dramatically reduce the size of data that
+needs to be stored, reducing row counts by potentially orders of magnitude. 
This storage reduction does come at a cost:
+as we roll up data, we lose the ability to query individual events.
+When rollup is disabled, Druid loads each row as-is without doing any form of 
pre-aggregation. This mode is similar
+to what you would expect from a typical database that does not support a 
rollup feature.
+When rollup is enabled, then any rows that have identical 
[dimensions](#dimensions) and [timestamp](#primary-timestamp)
+to each other (after [`queryGranularity`-based truncation](#granularityspec)) 
can be collapsed, or _rolled up_, into a
+single row in Druid.
+By default, rollup is enabled.
+### Enabling or disabling rollup
+Rollup is controlled by the `rollup` setting in the 
[`granularitySpec`](#granularityspec). By default, it is `true`
+(enabled). Set this to `false` if you want Druid to store each record as-is, 
without any rollup summarization.
+### Example of rollup
+For an example of how to configure rollup, and of what how the feature will 
modify your data, check out the
 Review comment:
   Typo: of what how -> of how

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to