Colocating services — based on Timezone
Last week we were discussing of resource optimisation and suddenly the timezone based resource scheduling came up. I strongly believe the colocation can be chosen based on the well known facts of the timezones across globe. I thought of doing a POC for this and the details follow below.
Requirement:
It is normal practice most of the SaaS products works completely on cloud 24/7/365. Most of the B2B products among them work during office hours. There is every reason one might think to reuse the resources (like cloud servers), which are used only during working hours by colocating the data of customer in same servers.
Important: Such a sharing/colocation is possible only when we are sure that their operating time are mutually exclusive
Proposed Solution:
The timezone across the globe is well known and we can identify the non-overlapping timezones easily with a program. For a given timezone one can easily list the timezones, which can be used to colocate.
Following is a basic implementation to check for 2 timezones conflict.
We can easily use this routine to build the required functionality needed. I have written couple of functionalities to identify all the non-conflicting timezone for a given timezone and another to generate all such combinations. You can refer the same @ https://github.com/arunk2/timezone-colocator
Hope it helps someone !