IP Library Granted Patent US 10,893,098
Granted Patent B2
US 10,893,098 · App. 16/553,077 · Granted Jan 12, 2021

Method and apparatus for data writing

Inventors: Yingqiang Zhang (Hangzhou, CN); Dengcheng He (Hangzhou, CN)
Assignee: ALIBABA GROUP HOLDING LIMITED
H04L67/1051G06F16/178G06F16/1844H04L67/1095
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,893,098
App. No.
16/553,077
Granted
Jan 12, 2021
Kind
B2
Abstract

Embodiments of present disclosure provides a method and an apparatus for data writing. An exemplary method includes: obtaining first to-be-written data; determining a first group identifier corresponding to the first to-be-written data; determining a master node corresponding to the first group identifier; and writing the first to-be-written data if the master node is the current node.

Claims (82)

1. A method for data writing implemented by a current node of a distributed database system, comprising:

obtaining first to-be-written data;

determining a first group identifier corresponding to the first to-be-written data;

determining a first master node corresponding to the first group identifier;

in response to the first master node being a first node of the distributed database system other than a current node,

determining a second group identifier, a second master node corresponding to the second group identifier being the current node,

sending the second group identifier to the first node,

receiving a first update message from the first node, the first update message indicating that at the first node, the first group identifier is modified to the second group identifier, and

modifying the first group identifier to the second group identifier; and

writing the first to-be-written data.

2. The method according to claim 1 , wherein determining the first group identifier corresponding to the first to-be-written data comprises:

determining a first data row in a first data table corresponding to the first to-be-written data; and

determining a group identifier in the first data row as the first group identifier.

3. The method according to claim 1 , wherein determining the first master node corresponding to the first group identifier comprises:

retrieving the first master node from a mapping table,

wherein the mapping table comprises a plurality of group identifiers and corresponding master nodes.

4. The method according to claim 1 , wherein determining the second group identifier comprises:

retrieving the second group identifier from a mapping table,

wherein the mapping table comprises a plurality of group identifiers and corresponding master nodes.

5. The method according to claim 1 , wherein sending the second group identifier to the first node comprises:

sending to the first node a notification message which comprises the second group identifier and index information of the first to-be-written data.

6. The method according to claim 1 , wherein modifying the first group identifier to the second group identifier comprises:

determining a first data row in a first data table corresponding to the first to-be-written data according to an index information in the update message.

7. The method according to claim 1 , further comprises:

if the first master node is the current node,

obtaining a second to-be-written data;

determining a third group identifier corresponding to the second to-be-written data;

determining a third master node corresponding to the third group identifier if the third group identifier is different from the first group identifier;

sending the first group identifier to a second node of the distributed database system other than the current node if the third master node is the second node; and

receiving a second update message from the second node, the second update message indicating that at the second node, the third group identifier is modified to the first group identifier;

modifying the third group identifier to the first group identifier; and

writing the second to-be-written data.

8. The method according to claim 7 , further comprising:

modifying the third group identifier to the first group identifier if the third master node is the current node;

writing the second to-be-written data; and

sending a third update message indicating the modification of the third group identifier to the first group identifier.

9. The method according to claim 7 , further comprising:

writing the second to-be-written data if the third group identifier is the same as the first group identifier.

10. The method according to claim 1 , further comprising:

if the first master node is the first node other than the current node,

obtaining a second to-be-written data;

determining a third group identifier corresponding to the second to-be-written data;

determining a third master node corresponding to the third group identifier if the third group identifier is different from the second group identifier;

sending the second group identifier to a second node of the distributed database system other than the current node if the third master node is the second node; and

receiving a third update message from the second node, the third update message indicating that at the second node, the third group identifier is modified to the second group identifier;

modifying the third group identifier to the second group identifier; and

writing the second to-be-written data.

11. The method according to claim 10 , further comprising:

modifying the third group identifier to the second group identifier if the third master node is the current node;

writing the third to-be-written data; and

sending a third update message indicating the modification of the third group identifier to the second group identifier.

12. The method according to claim 10 , further comprising:

writing the second to-be-written data if the third group identifier is the same as the second group identifier.

13. The method according to claim 1 , wherein the current node and the first node are located in different regions.

14. An apparatus for data writing at a current node of a distributed database system, comprising:

a memory storing a set of instructions; and

one or more processors configured to execute the set of instructions to cause the apparatus to perform:

obtaining first to-be-written data;

determining a first group identifier corresponding to the first to-be-written data;

determining a first master node corresponding to the first group identifier;

in response to the first master node being a first node of the distributed database system other than a current node,

determining a second group identifier, a second master node corresponding to the second group identifier being the current node,

sending the second group identifier to the first node,

receiving a first update message from the first node, the first update message indicating that at the first node, the first group identifier is modified to the second group identifier, and

modifying the first group identifier to the second group identifier; and

writing the first to-be-written data.

15. The apparatus according to claim 14 , wherein determining the first group identifier corresponding to the first to-be-written data comprises:

determining a first data row in a first data table corresponding to the first to-be-written data; and

determining a group identifier in the first data row as the first group identifier.

16. A non-transitory machine-readable storage medium storing a set of instructions that are executable by one or more processors of a current node of a distributed database system to cause the current node to perform a method comprising:

obtaining first to-be-written data;

determining a first group identifier corresponding to the first to-be-written data;

determining a first master node corresponding to the first group identifier;

in response to the first master node being a first node of the distributed database system other than a current node,

determining a second group identifier, a second master node corresponding to the second group identifier being the current node,

sending the second group identifier to the first node,

receiving a first update message from the first node, the first update message indicating that at the first node, the first group identifier is modified to the second group identifier, and

modifying the first group identifier to the second group identifier; and

writing the first to-be-written data.

17. The non-transitory machine-readable storage medium according to claim 16 , wherein determining the first group identifier corresponding to the first to-be-written data comprises:

determining a first data row in a first data table corresponding to the first to-be-written data; and

determining a group identifier in the first data row as the first group identifier.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 29, 2026
From: ALIBABA GROUP HOLDING LIMITED
To: CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PRIVATE LIMITED
Reel/Frame 075499/0384 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 9, 2020
From: ZHANG, YINGQIANG; HE, DENGCHENG
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 052886/0571 →
Priority Claims (1)
CN 2018 1 0994734 · Aug 29, 2018 · national
Continuity (1)
Related Publication 20200076890A1 · Mar 5, 2020