Patent attributes
Embodiments of the invention dynamically vary the number of replicas based on certain conditions to protect users from data loss. The size of the database is one condition that can be used to determine the number of replicas required. A database system may create three replicas. When the database size exceeds a first threshold, a fourth replica may be created. The fourth replica is maintained as long as the database size is above a second threshold that is smaller than the first threshold. However, when the database shrinks below the second threshold, then the fourth replica is deleted. Using two different thresholds in this manner prevents the system from frequently cycling between three and four replicas.