A method for replicating databases, in which method at least two databases are replicated, each database comprising one or more tables, and each table having data and a unique tree index in the form of a B tree or a B+ tree, the unique tree index comprising, on each tree index level, index keys and hierarchical sums of cyclic redundancy check values calculated from the data, the index keys being stored in a non-decreasing order, wherein the unique tree index comprises a plurality of leaf nodes, a plurality of internal nodes, a root node, and a sum of all cyclic redundancy check values (c 1...n) together with a pointer to the root node, each leaf node comprising cyclic redundancy check values (c 1...n) of the data rows in the table together with corresponding index keys (k 1...n), each internal node comprising a plurality of pointers to child nodes and, for each pointer except the last one, a sum of all the cyclic redundancy check values (c 1...n) in the corresponding child node and a corresponding index key (k 1...n), the cyclic redundancy check values of the child node pointed to by the last pointer being included in the sum of cyclic redundancy check values (c 1...n) of an associated parent node at the next higher tree index level; the root node comprising a plurality of pointers to child nodes and, for each pointer except the last one, a sum of all the cyclic redundancy check values (c 1...n) in the corresponding child node and a corresponding index key (k 1...n), the cyclic redundancy check values of the child node pointed to by the last pointer being included in the sum of all cyclic redundancy check values (c 1...n); each internal node having a variable number of child nodes within a predefined range of number of child nodes, wherein logical consistency of the data between corresponding tables in the databases is maintained by: comparing the sums of all cyclic redundancy check values (c 1...n) of the database tables; if a difference between the sums of all cyclic redundancy check values (c 1...n) is found, each tree index is logically divided into two sub tree indexes, and the sums of all cyclic redundancy check values (c 1...n) of the sub tree indexes are compared to each other; the comparison and division is continued until the data causing the difference is found, and the inconsistent data is replicated between the databases. at least two databases are replicated, each database comprising one or more tables, and each table having data and a unique tree index in the form of a B tree or a B+ tree, the unique tree index comprising, on each tree index level, index keys and hierarchical sums of cyclic redundancy check values calculated from the data, the index keys being stored in a non-decreasing order, wherein the unique tree index comprises a plurality of leaf nodes, a plurality of internal nodes, a root node, and a sum of all cyclic redundancy check values (c 1...n) together with a pointer to the root node, each leaf node comprising cyclic redundancy check values (c 1...n) of the data rows in the table together with corresponding index keys (k 1...n), each internal node comprising a plurality of pointers to child nodes and, for each pointer except the last one, a sum of all the cyclic redundancy check values (c 1...n) in the corresponding child node and a corresponding index key (k 1...n), the cyclic redundancy check values of the child node pointed to by the last pointer being included in the sum of cyclic redundancy check values (c 1...n) of an associated parent node at the next higher tree index level; the root node comprising a plurality of pointers to child nodes and, for each pointer except the last one, a sum of all the cyclic redundancy check values (c 1...n) in the corresponding child node and a corresponding index key (k 1...n), the cyclic redundancy check values of the child node pointed to by the last pointer being included in the sum of all cyclic redundancy check values (c 1...n); each internal node having a variable number of child nodes within a predefined range of number of child nodes, wherein logical consistency of the data between corresponding tables in the databases is maintained by: comparing the sums of all cyclic redundancy check values (c 1...n) of the database tables; if a difference between the sums of all cyclic redundancy check values (c 1...n) is found, each tree index is logically divided into two sub tree indexes, and the sums of all cyclic redundancy check values (c 1...n) of the sub tree indexes are compared to each other; the comparison and division is continued until the data causing the difference is found, and the inconsistent data is replicated between the databases. comparing the sums of all cyclic redundancy check values (c 1...n) of the database tables; if a difference between the sums of all cyclic redundancy check values (c 1...n) is found, each tree index is logically divided into two sub tree indexes, and the sums of all cyclic redundancy check values (c 1...n) of the sub tree indexes are compared to each other; the comparison and division is continued until the data causing the difference is found, and the inconsistent data is replicated between the databases.