A database log management method, wherein the method comprises: receiving, by a server, a first write transaction; generating and storing, by the server, a command log of the first write transaction, wherein the command log records a transaction command for the database and does not record a result of a transaction operation; detecting, by the server, whether the first write transaction is a multi-partition transaction, wherein the multi-partition transaction comprises a transaction for operating at least two partitions; and when the first write transaction is a multi-partition transaction, generating and storing, by the server, a data log of the first write transaction, wherein the data log records a result of a transaction operation; wherein, when a data fault occurs on the server and data is lost, the method further comprises: obtaining, by the server, a data snapshot of the server, wherein the data snapshot is used to back up data for the server; and obtaining, by the server, command logs generated after a generation time point of the data snapshot; and detecting, in a storage sequence of the command logs, whether write transactions corresponding to the obtained command logs are multi-partition transactions, and when detecting that a write transaction corresponding to the obtained command log is a multi-partition transaction, obtaining a data log of the write transaction corresponding to the obtained command log, and recovering data by replaying the obtained data log, and, for at least a part of the command logs, when detecting that the write transaction corresponding to the obtained command log is not a multi-partition transaction, recovering data by replaying the command log. receiving, by a server, a first write transaction; generating and storing, by the server, a command log of the first write transaction, wherein the command log records a transaction command for the database and does not record a result of a transaction operation; detecting, by the server, whether the first write transaction is a multi-partition transaction, wherein the multi-partition transaction comprises a transaction for operating at least two partitions; and when the first write transaction is a multi-partition transaction, generating and storing, by the server, a data log of the first write transaction, wherein the data log records a result of a transaction operation; wherein, when a data fault occurs on the server and data is lost, the method further comprises: obtaining, by the server, a data snapshot of the server, wherein the data snapshot is used to back up data for the server; and obtaining, by the server, command logs generated after a generation time point of the data snapshot; and detecting, in a storage sequence of the command logs, whether write transactions corresponding to the obtained command logs are multi-partition transactions, and when detecting that a write transaction corresponding to the obtained command log is a multi-partition transaction, obtaining a data log of the write transaction corresponding to the obtained command log, and recovering data by replaying the obtained data log, and, for at least a part of the command logs, when detecting that the write transaction corresponding to the obtained command log is not a multi-partition transaction, recovering data by replaying the command log. obtaining, by the server, a data snapshot of the server, wherein the data snapshot is used to back up data for the server; and obtaining, by the server, command logs generated after a generation time point of the data snapshot; and detecting, in a storage sequence of the command logs, whether write transactions corresponding to the obtained command logs are multi-partition transactions, and when detecting that a write transaction corresponding to the obtained command log is a multi-partition transaction, obtaining a data log of the write transaction corresponding to the obtained command log, and recovering data by replaying the obtained data log, and, for at least a part of the command logs, when detecting that the write transaction corresponding to the obtained command log is not a multi-partition transaction, recovering data by replaying the command log.