cube-js / cube

📊 Cube — The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.48k stars 1.74k forks source link

Epic: Improve deployment of pre-aggregations #1740

Open rpaik opened 3 years ago

rpaik commented 3 years ago

This is an Epic for improving the deployment of pre-aggregations.

Motivation

Goals/plans

benswinburne commented 3 years ago

This is something I've been struggling with and having to deploy changes with multiple steps at night to not affect users (but we're about to expand to users in various other timezones so this will be less viable shortly).

Add support for pre-aggregations warm-up.

@rpaik How do you envisage this working on a production environment?

For example, this bug https://github.com/cube-js/cube.js/issues/1825 is going to cause me to have to rename a pre-aggreagion which means there will be a period where the new name aggregations don't exist.

The current route to get around this is

† this is super wasteful on a database like Athena where I have all the aggregations, i just need to rename it, perhaps i could indicate that with a rename property instead?

rpaik commented 3 years ago

@paveltiunov can you help with @benswinburne's question 👆 ?

paveltiunov commented 3 years ago

@benswinburne So the current vision is to have 2 simultaneously running cube.js servers with different schema versions in a single cluster: one with the older schema to serve traffic and another one with the new schema to build/warmup pre-aggregations. Then blue-green deployment approach is applied to switch instances after warmup is complete. It works in Cube Cloud so you can test it there to get a sense of how it works.