druid/docs/dependencies/deep-storage.md
Gian Merlino de5a4bafcb
Zero-copy local deep storage. (#13394)
* Zero-copy local deep storage.

This is useful for local deep storage, since it reduces disk usage and
makes Historicals able to load segments instantaneously.

Two changes:

1) Introduce "druid.storage.zip" parameter for local storage, which defaults
   to false. This changes default behavior from writing an index.zip to writing
   a regular directory. This is safe to do even during a rolling update, because
   the older code actually already handled unzipped directories being present
   on local deep storage.

2) In LocalDataSegmentPuller and LocalDataSegmentPusher, use hard links
   instead of copies when possible. (Generally this is possible when the
   source and destination directory are on the same filesystem.)
2022-12-12 17:28:24 -08:00

3.3 KiB

id title
deep-storage Deep storage

Deep storage is where segments are stored. It is a storage mechanism that Apache Druid does not provide. This deep storage infrastructure defines the level of durability of your data, as long as Druid processes can see this storage infrastructure and get at the segments stored on it, you will not lose data no matter how many Druid nodes you lose. If segments disappear from this storage layer, then you will lose whatever data those segments represented.

Local

Local storage is intended for use in the following situations:

  • You have just one server.
  • Or, you have multiple servers, and they all have access to a shared filesystem (for example: NFS).

In multi-server production clusters, rather than local storage with a shared filesystem, it is instead recommended to use cloud-based deep storage (Amazon S3, Google Cloud Storage, or Azure Blob Storage), S3-compatible storage (like Minio), or HDFS. These options are generally more convenient, more scalable, and more robust than setting up a shared filesystem.

The following configurations in common.runtime.properties apply to local storage:

Property Possible Values Description Default
druid.storage.type local Must be set.
druid.storage.storageDirectory any local directory Directory for storing segments. Must be different from druid.segmentCache.locations and druid.segmentCache.infoDir. /tmp/druid/localStorage
druid.storage.zip true, false Whether segments in druid.storage.storageDirectory are written as directories (false) or zip files (true). false

For example:

druid.storage.type=local
druid.storage.storageDirectory=/tmp/druid/localStorage

The druid.storage.storageDirectory must be set to a different path than druid.segmentCache.locations or druid.segmentCache.infoDir.

Amazon S3 or S3-compatible

See druid-s3-extensions.

Google Cloud Storage

See druid-google-extensions.

Azure Blob Storage

See druid-azure-extensions.

HDFS

See druid-hdfs-storage extension documentation.

Additional options

For additional deep storage options, please see our extensions list.