Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-tenancy aware Time Zones #3509

Open
vincent-benbria opened this issue Oct 5, 2021 · 4 comments · May be fixed by #9002
Open

Multi-tenancy aware Time Zones #3509

vincent-benbria opened this issue Oct 5, 2021 · 4 comments · May be fixed by #9002
Labels
enhancement New feature proposal help wanted Community contributions are welcome.

Comments

@vincent-benbria
Copy link

Is your feature request related to a problem? Please describe.
I need to pre-aggregate on each timezone that my clients want reporting on, but I have a diversified group of clients and they are each mostly only interested in their own timezones.

The impact is pretty simple; I have ~500 clients, about 250 are interested in EST, 200 in PST, 5 in BST, 3 in BT (china) and the rest in basically all timezones across Canada/USA. Overall it means that each of my clients need data timezoned to an average of ~1.2 timezones each, but to provide the adequate coverage i need to enable 8 timezones, forcing me to cache 7 times more data than optimal.

Describe the solution you'd like
Introduce a per-tenant timezone list, similar to every other multi-tenancy options

@keydunov keydunov assigned keydunov and paveltiunov and unassigned keydunov Oct 14, 2021
@paveltiunov
Copy link
Member

Hey @vincent-benbria ! This is indeed a tricky issue. Unfortunately, there's no straightforward solution to that other than to have pre-aggregation per timezone. The reason for it, not all timezones have whole-hour shifts like IST so most of the time hourly granularity doesn't help, and minute one doesn't make sense. Even if we can reduce the timezone set to whole hour shifts daylight saving time becomes the next problem because it's different in each timezone.

If you have a lot of tenants most likely you want to consider grouping tenants in one pre-aggregation table and have pre-aggregations per timezone.

@paveltiunov paveltiunov added the question The issue is a question. Please use Stack Overflow for questions. label Oct 21, 2021
@vincent-benbria
Copy link
Author

Yes, I do realize that there are half-hour timezones and such.

I am asking for the ability to specify which timezones is aggregated PER tenant, so that my Chinese tenant data is not also preaggregated for EST simply because I also have EST tenants.

@paveltiunov
Copy link
Member

paveltiunov commented Nov 25, 2021

@vincent-benbria I see what you're saying. Yeah. It makes sense to have an option to control it on a per-tenant level. I guess it should be done here:
https://github.com/cube-js/cube.js/blob/d143d4dda87a9fac4139fdf47f70b3cdc0b0009b/packages/cubejs-server-core/src/core/server.ts#L783

Looking forward to contributions here!

@paveltiunov paveltiunov added enhancement New feature proposal help wanted Community contributions are welcome. and removed question The issue is a question. Please use Stack Overflow for questions. labels Nov 25, 2021
@paveltiunov paveltiunov removed their assignment Nov 25, 2021
@github-actions
Copy link

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you.
If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines.
You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature proposal help wanted Community contributions are welcome.
Projects
None yet
3 participants