Multi-master data replication in a distributed multi-tenant system
First Claim
Patent Images
1. A method comprising:
- monitoring for changes to a replicated database by an instance of the replicated database, wherein the instance is one of a plurality instances of the replicated database, and each instance is separately responsible for multiple database tables local to the respective instances, and wherein the plurality of instances of the replicated database comprise two or more data centers each data center having a leader instance and one or more non-leader instances, the one or more non-leader instances to communicate with other non-leader instances of the same data center and the leader instance of the same data center and not to instances of other data centers, the leader instance to communicate with leader instances of other data centers and not with non-leader instances of other data centers, the monitoring includingdetecting by the instance a change to at least one record of the local database tables;
in response to the detecting, adding information to a chunk, wherein a chunk stores metadata about record changes and corresponds to a discrete unit of progress and is specific to a single instance and provide a single consistent unit for both change detection and transport; and
serving the chunk to another instance of the replicated database via one or more leader instances to replicate the detected change to the other instance; and
receiving by the instance a chunk from a remote instance of the replicated database, which has metadata identifying a set of changed records for database tables of the remote instance;
in response to the receiving, requesting underlying data for changed records indicated in the received chunk via the one or more leader instances; and
upserting the changed records into the local database tables.
1 Assignment
0 Petitions
Accused Products
Abstract
A multi-master replication system is disclosed. The multi-master replication system allows a large set of peer instances to collaboratively replicate data to each other.
160 Citations
36 Claims
-
1. A method comprising:
-
monitoring for changes to a replicated database by an instance of the replicated database, wherein the instance is one of a plurality instances of the replicated database, and each instance is separately responsible for multiple database tables local to the respective instances, and wherein the plurality of instances of the replicated database comprise two or more data centers each data center having a leader instance and one or more non-leader instances, the one or more non-leader instances to communicate with other non-leader instances of the same data center and the leader instance of the same data center and not to instances of other data centers, the leader instance to communicate with leader instances of other data centers and not with non-leader instances of other data centers, the monitoring including detecting by the instance a change to at least one record of the local database tables; in response to the detecting, adding information to a chunk, wherein a chunk stores metadata about record changes and corresponds to a discrete unit of progress and is specific to a single instance and provide a single consistent unit for both change detection and transport; and serving the chunk to another instance of the replicated database via one or more leader instances to replicate the detected change to the other instance; and receiving by the instance a chunk from a remote instance of the replicated database, which has metadata identifying a set of changed records for database tables of the remote instance; in response to the receiving, requesting underlying data for changed records indicated in the received chunk via the one or more leader instances; and upserting the changed records into the local database tables. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A non-transitory machine readable storage medium storing instructions, which when executed by a machine cause the machine to perform operations including:
-
monitoring for changes to a replicated database by an instance of the replicated database, wherein the instance is one of a plurality instances of the replicated database, and each instance is separately responsible for multiple database tables local to the respective instances, and wherein the plurality of instances of the replicated database comprise two or more data centers each data center having a leader instance and one or more non-leader instances, the one or more non-leader instances to communicate with other non-leader instances of the same data center and the leader instance of the same data center and not to instances of other data centers, the leader instance to communicate with leader instances of other data centers and not with non-leader instances of other data centers, the monitoring including detecting by the instance a change to at least one record of the local database tables; in response to the detecting, adding information to a chunk, wherein a chunk stores metadata about record changes and corresponds to a discrete unit of progress and is specific to a single instance and provide a single consistent unit for both change detection and transport; and serving the chunk to another instance of the replicated database via one or more leader instances to replicate the detected change to the other instance; and receiving by the instance a chunk from a remote instance of the replicated database, which has metadata identifying a set of changed records for database tables of the remote instance; in response to the receiving, requesting underlying data for changed records indicated in the received chunk via the one or more leader instances; and upserting the changed records into the local database tables. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
-
-
25. An apparatus for managing a replicated database in an on-demand database system, comprising:
-
a processor; and a memory device having a sequence of instructions stored thereon, which when executed by the processor, cause the processor to carry out operations including monitoring for changes to a replicated database by an instance of the replicated database, wherein the instance is one of a plurality instances of the replicated database, and each instance is separately responsible for multiple database tables local to the respective instances, and wherein the plurality of instances of the replicated database comprise two or more data centers each data center having a leader instance and one or more non-leader instances, the one or more non-leader instances to communicate with other non-leader instances of the same data center and the leader instance of the same data center and not to instances of other data centers, the leader instance to communicate with leader instances of other data centers and not with non-leader instances of other data centers, the monitoring including detecting by the instance a change to at least one record of the local database tables; in response to the detecting, adding information to a chunk, wherein a chunk stores metadata about record changes and corresponds to a discrete unit of progress and is specific to a single instance and provide a single consistent unit for both change detection and transport; and serving the chunk to another instance of the replicated database via one or more leader instances to replicate the detected change to the other instance; and receiving by the instance a chunk from a remote instance of the replicated database, which has metadata identifying a set of changed records for database tables of the remote instance; in response to the receiving, requesting underlying data for changed records indicated in the received chunk via the one or more leader instances; and upserting the changed records into the local database tables. - View Dependent Claims (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
-
Specification