1. A computer-implemented method for distributing tasks from an external application based on consensus among a plurality of application instances in a database system, the application instances communicating with a DBMS having a membership table of the application instances participating in a membership group and a map of partitions each corresponding to a set of tasks, the method comprising: identifying, by each application instance in the membership group, a current partition ownership by the instances based on a time window; generating a new membership group and a new partition ownership based on the current partition ownership; and recording the new membership group and new partition ownership in the membership table and the partition map.