Distributed databases often suffer unequal distribution of data among storage nodes, which is known as `data skew'. Data skew arises from a number of causes such as removal of existing storage nodes and addition of new empty nodes to the database. Data skew leads to performance degradations and necessitates `rebalancing' at regular intervals to reduce the amount of skew. We define an $r$-balanced distributed database as a distributed database in which the storage across the nodes has uniform size, and each bit of the data is replicated in $r$ distinct storage nodes. We consider the problem of designing such balanced databases along with associated rebalancing schemes which maintain the $r$-balanced property under node removal and addition operations. We present a class of $r$-balanced databases (parameterized by the number of storage nodes) which have the property of structural invariance, i.e., the databases designed for different number of storage nodes have the same structure. For this class of $r$-balanced databases, we present rebalancing schemes which use coded transmissions between storage nodes, and characterize their communication loads under node addition and removal. We show that the communication cost incurred to rebalance our distributed database for node addition and removal is optimal, i.e., it achieves the minimum possible cost among all possible balanced distributed databases and rebalancing schemes.