This project is read-only.
0
Vote

Build instance rebalance logic

description

Given multiple instances of the app host, as the new tenants are added, or removed, we do a refresh, by deleting all of the config and redistribute all of the instances. Instead of doing that, devise an algorithm, where each time a tenant is deleted, we check the balance of the tenants accross the instances, and move a tenant to a diffent instance as necessary. Example:
 
BEGIN:
Instance 1:
t1
t2
t3
 
Instance 2:
t4
t5
t6
 
NEXT
Add tenant t7
 
CURRENTLY, before adding, all of the config is deleted, and tenants are placed/deployed again
 
DESIRED: add to instance 1 (decide arbitrarily if tenants are equal)
 
NEXT
Add tenant 8
 
DESIRED: add T8 to instance 2 directly, w/o deleting all 7 tenants.

comments