@@ -10,16 +10,20 @@ redirect_from:
1010---
1111
1212This section contains a general overview of deploying a Cube cluster in
13- production. You can find platform-specific guides for:
14-
15- - [ Cube Cloud] [ ref-deploy-cubecloud ]
16- - [ Docker] [ ref-deploy-docker ]
13+ production. You can also check platform-specific guides for [ Cube
14+ Cloud] [ ref-deploy-cubecloud ] and [ Docker] [ ref-deploy-docker ] .
1715
1816If you are moving Cube to production, check out the [ Production
1917Checklist] [ ref-deploy-prod-list ] .
2018
21- As shown in the diagram below, a typical production Cube cluster consists of one
22- or multiple API instances, a Refresh Worker and a Cube Store cluster.
19+ ## Components
20+
21+ As shown in the diagram below, a typical production deployment of Cube includes
22+ the following components:
23+
24+ - One or multiple API instances
25+ - A Refresh Worker
26+ - A Cube Store cluster
2327
2428<div style = " text-align: center" >
2529 <img
@@ -42,86 +46,10 @@ also need access to the data schema files.
4246
4347Cube Store cluster can be configured via environment variables.
4448
45- Below you can find an example Docker Compose configuration for a Cube cluster:
46-
47- ``` yaml
48- version : ' 2.2'
49-
50- services :
51- cube_api :
52- image : cubejs/cube
53- ports :
54- - 4000:4000
55- environment :
56- - CUBEJS_DB_TYPE=bigquery
57- - CUBEJS_DB_BQ_PROJECT_ID=cubejs-k8s-cluster
58- - CUBEJS_DB_BQ_CREDENTIALS=<BQ-KEY>
59- - CUBEJS_DB_EXPORT_BUCKET=cubestore
60-
61- - CUBEJS_CUBESTORE_HOST=cubestore_router
62-
63- - CUBEJS_API_SECRET=secret
64- volumes :
65- - .:/cube/conf
66- depends_on :
67- - cubestore_worker_1
68- - cubestore_worker_2
69- - cube_refresh_worker
70-
71- cube_refresh_worker :
72- image : cubejs/cube
73- environment :
74- - CUBEJS_DB_TYPE=bigquery
75- - CUBEJS_DB_BQ_PROJECT_ID=cubejs-k8s-cluster
76- - CUBEJS_DB_BQ_CREDENTIALS=<BQ-KEY>
77- - CUBEJS_DB_EXPORT_BUCKET=cubestore
78-
79- - CUBEJS_CUBESTORE_HOST=cubestore_router
80-
81- - CUBEJS_API_SECRET=secret
82-
83- - CUBEJS_REFRESH_WORKER=true
84- volumes :
85- - .:/cube/conf
49+ You can find an example Docker Compose configuration for a Cube deployment in
50+ the platform-specific guide for [ Docker] [ ref-deploy-docker ] .
8651
87- cubestore_router :
88- image : cubejs/cubestore:latest
89- environment :
90- - CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
91- - CUBESTORE_REMOTE_DIR=/cube/data
92- - CUBESTORE_META_PORT=9999
93- - CUBESTORE_SERVER_NAME=cubestore_router:9999
94- volumes :
95- - .cubestore:/cube/data
96-
97- cubestore_worker_1 :
98- image : cubejs/cubestore:latest
99- environment :
100- - CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
101- - CUBESTORE_SERVER_NAME=cubestore_worker_1:10001
102- - CUBESTORE_WORKER_PORT=10001
103- - CUBESTORE_REMOTE_DIR=/cube/data
104- - CUBESTORE_META_ADDR=cubestore_router:9999
105- volumes :
106- - .cubestore:/cube/data
107- depends_on :
108- - cubestore_router
109-
110- cubestore_worker_2 :
111- image : cubejs/cubestore:latest
112- environment :
113- - CUBESTORE_WORKERS=cubestore_worker_1:10001,cubestore_worker_2:10002
114- - CUBESTORE_SERVER_NAME=cubestore_worker_2:10002
115- - CUBESTORE_WORKER_PORT=10002
116- - CUBESTORE_REMOTE_DIR=/cube/data
117- - CUBESTORE_META_ADDR=cubestore_router:9999
118- volumes :
119- - .cubestore:/cube/data
120- depends_on :
121- - cubestore_router
122- ` ` `
123-
124- ## API Instance
52+ ## API instances
12553
12654API instances process incoming API requests and query either Cube Store for
12755pre-aggregated data or connected data sources for raw data. It is possible to
@@ -135,12 +63,12 @@ has access to the data schema files.
13563
13664## Refresh Worker
13765
138- A Refresh Worker updates pre-aggregations and invalidates the in-memory cache in the
139- background. They also keep the refresh keys up-to-date for all defined schemas
140- and pre-aggregations.
141- Please note that the in-memory cache is just invalidated but not populated by Refresh Worker.
142- In-memory cache is populated lazily during querying.
143- On the other hand, pre-aggregations are eagerly populated and kept up-to-date by Refresh Worker.
66+ A Refresh Worker updates pre-aggregations and invalidates the in-memory cache in
67+ the background. They also keep the refresh keys up-to-date for all defined
68+ schemas and pre-aggregations. Please note that the in-memory cache is just
69+ invalidated but not populated by Refresh Worker. In-memory cache is populated
70+ lazily during querying. On the other hand, pre-aggregations are eagerly
71+ populated and kept up-to-date by Refresh Worker.
14472
14573[ Cube Docker image] [ dh-cubejs ] can be used for creating Refresh Workers; to make
14674the service act as a Refresh Worker, ` CUBEJS_REFRESH_WORKER=true ` should be set
@@ -275,6 +203,22 @@ services:
275203 - cubestore_router
276204` ` `
277205
206+ ## Redis
207+
208+ Earlier, [Redis][redis] was used in production deployments as storage
209+ for in-memory cache and query queue. Since version v0.32.0, Cube Store is used
210+ for that purpose. It is still possible to [configure][ref-config-redis] Cube to
211+ use Redis; however, it is strongly not recommended. Please check the [blog
212+ post][blog-details] for details.
213+
214+ <WarningBox>
215+
216+ Redis support is deprecated and will be removed from Cube in the future. Upgrade
217+ to v0.32.0 or later to use Cube Store instead of Redis. See the [migration
218+ guide][blog-migration-guide].
219+
220+ </WarningBox>
221+
278222[dh-cubejs]: https://hub.docker.com/r/cubejs/cube
279223[dh-cubestore]: https://hub.docker.com/r/cubejs/cubestore
280224[gh-cube-examples-k8s]:
@@ -286,3 +230,8 @@ services:
286230[ref-deploy-docker]: /deployment/platforms/docker
287231[ref-config-env]: /reference/environment-variables
288232[ref-config-js]: /config
233+ [redis]: https://redis.io
234+ [ref-config-redis]: /reference/environment-variables#cubejs-redis-password
235+ [blog-details]: https://cube.dev/blog/how-you-win-by-using-cube-store-part-1
236+ [blog-migration-guide]:
237+ https://cube.dev/blog/how-you-win-by-using-cube-store-part-1#how-to-migrate-to-cube-store
0 commit comments