1. Technical Field
Embodiments of the present disclosure generally relate to data processing technology, and particularly to a server and a method for storing data.
2. Description of Related Art
To ensure data security, a server may store data received from a client to more than one storage node. A storage node may be, but is not limited to, a hard disk drive (HDD), a solid state drive (SSD), or a storage area network (SAN). After the data has been stored in the more than one storage node, the server transmits a feedback message to the client. However, if the client transmits a large number of data to the server, it may take a lot of time for the client to wait for the feedback message. Therefore, there is room for improvement in the art.
The disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language. One or more software instructions in the modules may be embedded in hardware, such as in an erasable programmable read only memory (EPROM). The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
In one embodiment, the management unit 10 may include one or more function modules (as shown in
In step S10, the receiving module 100 receives data sent from a client 2.
In step S12, the storing module 102 stores the data into a first storage node 50. In the embodiment, the first storage node 50 is determined according to a request of the client 2 or a remaining storage space of each storage node 50. For example, if the client 2 requires to store the data in a storage node “A”, or the remaining storage space of the storage node “A” is greater than other storage nodes, the storing module 102 distributes the data to the storage node “A”.
In step S14, the record module 103 creates a summary list 40 (as shown in
For example, as shown in
In step S16, the transmission module 104 transmits a feedback message to the client 2. In the embodiment, the feedback message indicates whether the data has been successfully stored into the first storage node 50. If the data fails to be stored into the first storage node 50, there is no need to implement the synchrony procedure.
In step S20, the acquisition module 105 acquires the summary list 40 from the storage unit 20 and reads the summary information from the summary list 40.
In step S22, the determination module 106 determines whether the data in the summary list 40 has been stored into each corresponding storage node 50 according to the summary information (e.g., the storage statuses). For example, as shown in
In step S24, the reading module 107 reads the data stored in the first storage node according to the summary information (e.g., the address of the first storage node). In the embodiment, if the data has not been stored into each corresponding storage node 50, the reading module 107 finds the first storage node that stores the data according to the address of the first storage node, and reads the data from the first storage node.
In step S26, the copy module 108 copies the data read from the first storage node to a next storage node. In the embodiment, the next storage node is determined according to the requirement of the client 2 or the remaining storage space of each storage node 50. For example, if the client 2 requires to store the data in the storage node “A” and the storage node “B”, or the remaining storage space of the storage node “B” is only smaller than the storage node “A” but greater than any other storage nodes, the copy module 108 copies data read from the storage node “A” to the storage node “B”. As shown in
In step S28, the amending module 109 amends the summary information of the data in the summary list 40, then the synchrony procedure returns to step S20. In the embodiment, the amending module 109 amends a storage status corresponding to a storage node 50 of the data after the data has been copied to the storage node 50. For example, as shown in
Although certain embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2012105616519 | Dec 2012 | CN | national |