Patent ID: 8874587

Claim:
A method for generating a data fetching plan in a multi-tenant system, comprising: placing tenants in consecutively allocated databases using a processor according to a weighted graph of tenants and sharing relationships between tenants, where at least one sharing relationship includes multiple accessing tenants accessing a given set of data from a provider tenant; and for each such sharing relationship: if a current database has one or more accessing tenants and does not have the provider tenant, fetching data from the latest-allocated database prior to the current database that has accessing tenants, if such a database exists; if a current database has the provider tenant, providing data to the earliest-allocated database after the current database that has accessing tenants if such a database exists; performing Bin Packing with one-to-Many Sharings (BPMS) with inputs including a set of vertices V, a set of sharings S among the vertices, and a bin capacity B, each vertex u∈V is associated with a non-negative weight w V (u), each sharing s∈S is defined as s=(u,U) where u∈V, U⊂V and u∉U, each sharing s is associated with two non-negative weights: w in (s) and w out (s); and repeating said fetching and providing steps for each allocated database.