blob: 7da46bcb8199ba03adf422bd2abe00a760219cb4 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[38],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>g});var a=r(67294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),d=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=d(e.components);return a.createElement(s.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=d(r),c=n,g=u["".concat(s,".").concat(c)]||u[c]||m[c]||o;return r?a.createElement(g,i(i({ref:t},p),{},{components:r})):a.createElement(g,i({ref:t},p))}));function g(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,i=new Array(o);i[0]=c;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:n,i[1]=l;for(var d=2;d<o;d++)i[d]=r[d];return a.createElement.apply(null,i)}return a.createElement.apply(null,r)}c.displayName="MDXCreateElement"},92356:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>g,frontMatter:()=>l,metadata:()=>d,toc:()=>u});var a=r(87462),n=r(63366),o=(r(67294),r(3905)),i=["components"],l={id:"deep-storage",title:"Deep storage"},s=void 0,d={unversionedId:"design/deep-storage",id:"design/deep-storage",title:"Deep storage",description:"\x3c!--",source:"@site/docs/28.0.1/design/deep-storage.md",sourceDirName:"design",slug:"/design/deep-storage",permalink:"/docs/28.0.1/design/deep-storage",draft:!1,tags:[],version:"current",frontMatter:{id:"deep-storage",title:"Deep storage"},sidebar:"docs",previous:{title:"Processes and servers",permalink:"/docs/28.0.1/design/processes"},next:{title:"Metadata storage",permalink:"/docs/28.0.1/design/metadata-storage"}},p={},u=[{value:"Deep storage options",id:"deep-storage-options",level:2},{value:"Local",id:"local",level:3},{value:"Amazon S3 or S3-compatible",id:"amazon-s3-or-s3-compatible",level:3},{value:"Google Cloud Storage",id:"google-cloud-storage",level:3},{value:"Azure Blob Storage",id:"azure-blob-storage",level:3},{value:"HDFS",id:"hdfs",level:3},{value:"Additional options",id:"additional-options",level:3},{value:"Querying from deep storage",id:"querying-from-deep-storage",level:2}],m={toc:u},c="wrapper";function g(e){var t=e.components,r=(0,n.Z)(e,i);return(0,o.kt)(c,(0,a.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"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."),(0,o.kt)("p",null,"In addition to being the backing store for segments, you can use ",(0,o.kt)("a",{parentName:"p",href:"#querying-from-deep-storage"},"query from deep storage")," and run queries against segments stored primarily in deep storage. The ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/operations/rule-configuration#load-rules"},"load rules")," you configure determine whether segments exist primarily in deep storage or in a combination of deep storage and Historical processes."),(0,o.kt)("h2",{id:"deep-storage-options"},"Deep storage options"),(0,o.kt)("p",null,"Druid supports multiple options for deep storage, including blob storage from major cloud providers. Select the one that fits your environment."),(0,o.kt)("h3",{id:"local"},"Local"),(0,o.kt)("p",null,"Local storage is intended for use in the following situations:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"You have just one server."),(0,o.kt)("li",{parentName:"ul"},"Or, you have multiple servers, and they all have access to a shared filesystem (for example: NFS).")),(0,o.kt)("p",null,"In multi-server production clusters, rather than local storage with a shared filesystem, it is instead recommended to\nuse cloud-based deep storage (",(0,o.kt)("a",{parentName:"p",href:"#amazon-s3-or-s3-compatible"},"Amazon S3"),", ",(0,o.kt)("a",{parentName:"p",href:"#google-cloud-storage"},"Google Cloud Storage"),",\nor ",(0,o.kt)("a",{parentName:"p",href:"#azure-blob-storage"},"Azure Blob Storage"),"), S3-compatible storage (like Minio), or ",(0,o.kt)("a",{parentName:"p",href:"#hdfs"},"HDFS"),". These options are\ngenerally more convenient, more scalable, and more robust than setting up a shared filesystem."),(0,o.kt)("p",null,"The following configurations in ",(0,o.kt)("inlineCode",{parentName:"p"},"common.runtime.properties")," apply to local storage:"),(0,o.kt)("table",null,(0,o.kt)("thead",{parentName:"table"},(0,o.kt)("tr",{parentName:"thead"},(0,o.kt)("th",{parentName:"tr",align:null},"Property"),(0,o.kt)("th",{parentName:"tr",align:null},"Possible Values"),(0,o.kt)("th",{parentName:"tr",align:null},"Description"),(0,o.kt)("th",{parentName:"tr",align:null},"Default"))),(0,o.kt)("tbody",{parentName:"table"},(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"druid.storage.type")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"local")),(0,o.kt)("td",{parentName:"tr",align:null}),(0,o.kt)("td",{parentName:"tr",align:null},"Must be set.")),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"druid.storage.storageDirectory")),(0,o.kt)("td",{parentName:"tr",align:null},"any local directory"),(0,o.kt)("td",{parentName:"tr",align:null},"Directory for storing segments. Must be different from ",(0,o.kt)("inlineCode",{parentName:"td"},"druid.segmentCache.locations")," and ",(0,o.kt)("inlineCode",{parentName:"td"},"druid.segmentCache.infoDir"),"."),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"/tmp/druid/localStorage"))),(0,o.kt)("tr",{parentName:"tbody"},(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"druid.storage.zip")),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"true"),", ",(0,o.kt)("inlineCode",{parentName:"td"},"false")),(0,o.kt)("td",{parentName:"tr",align:null},"Whether segments in ",(0,o.kt)("inlineCode",{parentName:"td"},"druid.storage.storageDirectory")," are written as directories (",(0,o.kt)("inlineCode",{parentName:"td"},"false"),") or zip files (",(0,o.kt)("inlineCode",{parentName:"td"},"true"),")."),(0,o.kt)("td",{parentName:"tr",align:null},(0,o.kt)("inlineCode",{parentName:"td"},"false"))))),(0,o.kt)("p",null,"For example:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre"},"druid.storage.type=local\ndruid.storage.storageDirectory=/tmp/druid/localStorage\n")),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"druid.storage.storageDirectory")," must be set to a different path than ",(0,o.kt)("inlineCode",{parentName:"p"},"druid.segmentCache.locations")," or\n",(0,o.kt)("inlineCode",{parentName:"p"},"druid.segmentCache.infoDir"),"."),(0,o.kt)("h3",{id:"amazon-s3-or-s3-compatible"},"Amazon S3 or S3-compatible"),(0,o.kt)("p",null,"See ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/development/extensions-core/s3"},(0,o.kt)("inlineCode",{parentName:"a"},"druid-s3-extensions")),"."),(0,o.kt)("h3",{id:"google-cloud-storage"},"Google Cloud Storage"),(0,o.kt)("p",null,"See ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/development/extensions-core/google"},(0,o.kt)("inlineCode",{parentName:"a"},"druid-google-extensions")),"."),(0,o.kt)("h3",{id:"azure-blob-storage"},"Azure Blob Storage"),(0,o.kt)("p",null,"See ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/development/extensions-core/azure"},(0,o.kt)("inlineCode",{parentName:"a"},"druid-azure-extensions")),"."),(0,o.kt)("h3",{id:"hdfs"},"HDFS"),(0,o.kt)("p",null,"See ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/development/extensions-core/hdfs"},"druid-hdfs-storage extension documentation"),"."),(0,o.kt)("h3",{id:"additional-options"},"Additional options"),(0,o.kt)("p",null,"For additional deep storage options, please see our ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/configuration/extensions"},"extensions list"),"."),(0,o.kt)("h2",{id:"querying-from-deep-storage"},"Querying from deep storage"),(0,o.kt)("p",null,"Although not as performant as querying segments stored on disk for Historical processes, you can query from deep storage to access segments that you may not need frequently or with the extreme low latency Druid queries traditionally provide. You trade some performance for a total lower storage cost because you can access more of your data without the need to increase the number or capacity of your Historical processes."),(0,o.kt)("p",null,"For information about how to run queries, see ",(0,o.kt)("a",{parentName:"p",href:"/docs/28.0.1/querying/query-deep-storage"},"Query from deep storage"),"."))}g.isMDXComponent=!0}}]);