# Patent

## Title
Highly scalable and distributed data de-duplication

## Abstract

This disclosure relates to systems and methods for both maintaining referential integrity within a data storage system, and freeing unused storage in the system, without the need to maintain reference counts to the blocks of storage used to represent and store the data.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This application is a continuation of U.S. Ser. No. 13/049,095 filed Mar. 16, 2011 and claims priority to U.S. Provisional Application 61/314,293 filed Mar. 16, 2010, the entire contents of each of which are incorporated herein by reference. This disclosure is also related to the disclosure in U.S. patent application Ser. No. 12/642,023, filed Dec. 18, 2009 and published as U.S. Publication No. 2010/0161608 A1, which is incorporated herein by reference.


FIELD OF THE DISCLOSURE
This disclosure relates to data management systems, and more specifically to maintaining referential integrity in such systems.
BACKGROUND
Modern computer systems hold vast quantities of data that is increasing rapidly; so rapidly, in fact, that in many cases the increase threatens to outstrip the capacity of storage systems. This growth not only needs a continuing investment in newer and bigger storage systems, it also requires a corresponding increase in the cost of managing those systems. It is highly desirable to decrease the amount of storage within a company, as the storage can significantly reduce the capital and operational expenditure of a company.
One characteristic of the data stored in most mass storage systems is that there is a tremendous amount of duplication of data. Examples include duplicate files, files that are slightly different (e.g. multiple drafts of the document), same images being stored in multiple documents, same templates or stationery being applied to presentations etc. While there are some systems that can detect identical files and store them only once, typical systems still require storing large amount of duplicate data. For example, practically every document in a company has the company logo embedded within it, but today's storage techniques are unable to recognize that the same data for the logo is being repeated in every document and are unable to save on storage for that.
There is increased emphasis on sub-file data de-duplication to detect duplicate data at a sub-file level to reduce the storage and network footprint for primal storage as well as secondary storage uses like backup and archive. In recent times, various systems have been designed that can detect duplicate data at sub-file level. De-duplication systems typically create one or more ‘chunks’ out of the file or block storage unit being analyzed for de-duplication and then employ one or more methods of comparison to detect whether a duplicate chunk has been produced.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates a method of maintaining reference counts to remove unreferenced blocks from a data de-duplication system in accordance with some embodiments.
FIG. 2 illustrates a method for updating block existence times to support removing unreferenced blocks from a data de-duplication system in a manner that does not rely upon reference counts of blocks in accordance with some embodiments.
FIG. 3 illustrates a method for removing unreferenced blocks from a data de-duplication system in a manner that does not rely upon reference counts of blocks in accordance with some embodiments.
FIG. 4 illustrates a method for adding a new file check sum in a data de-duplication system in a manner that does not rely upon reference counts of blocks in accordance with some embodiments.



OVERVIEW
One issue involved with representing data in a storage system as chunks is how to manage removing chunks that are no longer needed to represent any of the data stored in the system. Considerations when removing chunks include determining when non-referenced (non-used) chunks exist, when to free the storage associated with non-referenced chunks, and how to remove the non-referenced chunks in a manner that does not unduly detract from the system's performance.
As described in the text and figures of the incorporated U.S. Publication No. 2010/0161608 A1, representing data in a storage system as chunks can include one or more of the following steps applied to create chunks from a given piece of digital data (whether file, block, BLOB, or stream based) that needs to be de-duplicated:

    
    
        1. Break or “Chunk” the given digital data into “whole” logical objects by applying the knowledge about various formats of storing or transmitting digital data. For example, an image in a document would be a “whole” logical object stored in a format specific to the said document. File formats include examples such as .ppt, .doc, .xls, .pptx, .docx, .xlsx, .pdf, .xml, .cpp, .one, .mdb, and .a formats.
        2. Handle “Broken” Objects: assemble the logical object if it is physically not on contiguous storage/stream blocks. Sometimes while storing a logical object it can be broken into many small sub-objects that can be scattered across multiple storage blocks. In this case, the logical object is formed after identifying, all such sub-objects and assembling them in the correct order.
        3. Remove any format specific transformations applied to the logical object. For example, if the logical object is stored in a compressed format within a storage unit then that logical object is un-compressed first before using it as a chunk for de-duplication. Similarly if the logical object is stored as encrypted then that logical object is decrypted before using it as a chunk for de-duplication.
        4. Remove any format specific headers/footers attached to the logical objects. Most digital data formats either precede the logical object with a header or append a footer as part of or after inserting the logical object into the said digital data.
        5. Remove any position specific data and metadata from the logical block. Many digital data formats store positional data within or around the logical data, e.g. slide numbers in a PowerPoint document.
        6. If the object happens to be the file object, then assemble the file object first and then extract the logical objects using above steps. This allows one to find same objects e.g. image within a file object embedded in the compound files formats like .PST/.ZIP.
    
    


After the above one or more steps, what is left is a logical object in a native form that is independent of format specific transformations, embedded positional data, surrounding metadata, or effects of the object having been broken into multiple sub-objects for storage purposes. Operating on the logical object in its native form obtained using the methods described above enables one to find duplicate chunks of the data across even unrelated files. It is possible that only one or more steps are applied when identifying the chunk. Some objects may use different steps, and the particular steps used may are dependent on the file type and object type.
Partitioning digital data into chunks may include creating a map, such as a block map, that includes a list of objects/chunks that may be used to reconstitute the original digital data. In addition, the partitioning can also save data that has been removed from or around a chunk for later use. This data includes information about each of the objects that made up the original file, including the various methods that were applied to the original object in the file during the chunking process, as well as the non-chunk data such as page numbers. The data can be used re-apply/restore the various transformations and data that was removed from or around the constituent chunks during the partitioning process, and to reconstruct the original file using the combination of the chunks and the non-chunk data (e.g., position-dependent, instance-dependent, and/or header/footer data that was removed from the chunks and stored separately from them).
In one set of embodiments, a method comprises: partitioning, in a data storage system, each of a plurality of instances of digital data into a respective plurality of blocks, where each instance of digital data is represented by a file identifier, the file identifier referencing each of the respective plurality of blocks; and maintaining a last-reference-check timestamp for each of the blocks within each of the pluralities of blocks such that each last-reference-check timestamp indicates a last time, if ever, the block was validated to confirm that the block was referenced within the system; maintaining a last-validation timestamp for each file identifier such that each last-validation timestamp indicates when, if ever, each block referenced by the file identifier had been validated to confirm that the file identifier referenced the respective block; removing a block from the data storage system when the last-reference-check timestamp associated with the block is earlier than the earliest last-validation timestamp in the system. In certain of these embodiments partitioning each of the plurality of instances of digital data includes: partitioning a new instance of digital data into a plurality of blocks, including a first block, generating a first file identifier based at least in part on the new digital data; associating the first file identifier with the first block and the new digital data such that the first block is referenced by the first file identifier; storing the first file identifier in the data storage system; setting the first file identifier's last-validation timestamp to the current time; storing the first block in the data storage system if the first block has not already been stored; determining if the system is currently in the process of removing unreferenced blocks; and if the system is currently in the process of removing unreferenced blocks, setting the first block's last-reference-check timestamp to the current time. In certain of these embodiments, maintaining a last-reference-check timestamp and maintaining a last-validation timestamp for each file identifier include: repeatedly performing a block reference update, the block reference update comprising: identifying the file identifier with the oldest last-validation timestamp in the data storage system as the current-file-identifier, validating each block referenced by the current-file-identifier such that each such block's last-reference-check timestamp is set to the current time; and updating the current-file-identifier's last-validation timestamp to the current time. In certain of these embodiments, each block in the storage system may exist in either a recycling bin or a primary storage bin, and where validating each block referenced by the current-file-identifier includes: if the block being validated does not exist in the primary storage bin, but does exist in the recycling bin, moving the block being validated back from the recycling bin to the primary storage bin; and if the block being validated exists neither in the primary storage bin nor the recycling bin, marking the current-file-identifier as invalid. In certain other of these embodiments, removing a block from the data storage system includes: providing an indication that unreferenced blocks are currently in the process of being removed from the storage system; removing blocks from the data storage system whose last-reference-check timestamp is earlier than the earliest last-validation timestamp; providing an indication that unreferenced blocks are no longer in the process of being removed from the storage system. In certain of these embodiments, each block may exist in either a recycling bin or a primary storage bin, and where removing all blocks from the data storage system includes: for each block in the primary storage bin whose last-reference-check timestamp is earlier than the earliest last-validation timestamp, moving the block to the recycling bin and setting the block's last-reference-check timestamp to the current time; and for each block in the recycling bin whose last-reference-check timestamp is earlier than the earliest last-validation timestamp, removing the block from the recycling bin and freeing any storage associated with the removed block. In certain of these such embodiments, an instance of digital data is further partitioned into respective additional data, where a combination of the respective plurality of blocks and additional data together represent all of the digital data of the instance, the additional data including at least one of position-dependent data, instance-dependent data, format-specific headers or footers, and format-specific transformations. In certain of these embodiments, maintaining a last-reference-check timestamp for each of the blocks, maintaining a last-validation timestamp for each file identifier, and removing a block from the data storage system are performed concurrently.
In yet another set of embodiments a method comprises: partitioning, in a data storage system, digital data into a plurality of blocks, including a first block, where each of the plurality of blocks has a last-reference-check timestamp, the last-reference-check timestamp indicating the last time, if ever, the block was validated to confirm that the block was referenced within the system; generating a file identifier based at least in part on the digital data, where the file identifier has a last-validation timestamp, the last-validation timestamp indicating when, if ever, any blocks associated with the file identifier were validated; associating the file identifier with the first block and the digital data such that the first block is referenced by the file identifier; storing the file identifier in a storage system; setting the file identifier's last-validation timestamp to the current time; storing the first block in the storage system if the first block has not already been stored; determining if the system is currently in the process of removing unreferenced blocks; and if the system is currently in the process of removing unreferenced blocks, setting the first block's last-reference-check timestamp to the current time. In some such embodiments, the digital data is further partitioned into additional data, where a combination of the plurality of blocks and the additional data together represent all of the digital data, and the additional data includes at least one of position-dependent data, instance-dependent data, format-specific headers or footers, and format-specific transformations.
In another set of embodiments, a method comprises: partitioning, in a data storage system, each of a plurality of instances of digital data into a respective plurality of blocks, where each instance of digital data is represented by a file identifier, the file identifier referencing each the respective plurality of blocks, and where each of the blocks in the system has a last-reference-check timestamp, the last-reference-check timestamp indicating the last time, if ever, the block was validated to confirm that the block was referenced by at least one file identifier within the system, and where each file identifier has a last-validation timestamp, the last-validation timestamp indicating when, if ever, blocks referenced by the file identifier were validated; repeatedly performing a block reference update, the block reference update comprising: identifying the file identifier with the oldest last-validation timestamp in the data storage system as the current-file-identifier, validating each block referenced by the current-file-identifier such that each such block's last-reference-check timestamp is set to the current time; and updating the current-file-identifier's last-validation timestamp to the current time. In some such embodiments each block in the storage system may exist in either a recycling bin or a primary storage bin, and validating each block referenced by the current-file-identifier includes: if the block being validated does not exist in the primary storage bin, but does exist in the recycling bin, moving the block being validated back from the recycling bin to the primary storage bin; if the block being validated exists neither in the primary storage bin nor the recycling bin, marking the file identifier as invalid. In some such embodiments each instance of digital data is further partitioned into respective additional data, where a combination of the respective plurality of blocks and additional data together represent all of the digital data of the instance, the additional data including at least one of position-dependent data, instance-dependent data, format-specific headers or footers, and format-specific transformations.
In still another set of embodiments, a method comprises: partitioning, in a data storage system, each of a plurality of instances of digital data into a respective plurality of blocks, where each instance of digital data is represented by a file identifier, the file identifier referencing each the respective plurality of blocks, and where each of the blocks in the system has a last-reference-check timestamp, the last-reference-check timestamp indicating the last time, if ever, the block was validated to confirm that the block was referenced by at least one file identifier within the system, and where each file identifier has a last-validation timestamp, the last-validation timestamp indicating when, if ever, blocks referenced by the file identifier were validated; providing an indication that unreferenced blocks are currently in the process of being removed from the storage system; removing all blocks from the data storage system whose last-reference-check timestamp is earlier than the earliest last-validation timestamp; providing an indication that unreferenced blocks are no longer in the process of being removed from the storage system. In some such embodiments, each block may exist in either a recycling bin or a primary storage bin, and removing all blocks from the data storage system includes: for each block in the primary storage bin whose last-reference-check timestamp is earlier than the earliest last-validation timestamp, moving the block to the recycling bin and setting the block's last-reference-check timestamp to the current time; and for each block in the recycling bin whose last-reference-check timestamp is earlier than the earliest last-validation timestamp, removing the block from the recycling bin and freeing any storage associated with the removed block. In other such embodiments, each instance of digital data is further partitioned into respective additional data, where a combination of the respective plurality of blocks and additional data together represent all of the digital data of the instance, the additional data including at least one of position-dependent data, instance-dependent data, format-specific headers or footers, and format-specific transformations.
DESCRIPTION OF EXAMPLE EMBODIMENTS
A data de-duplication system can have the following basic components:

    
    
        a) one or more chunking algorithms or subsystems that analyze data streams and chunk them into blocks;
        b) one or more repositories in which data for blocks is stored; and
        c) one or more metadata repositories that store metadata, including the interrelationships of files, file identifiers such as file checksums, and the block units comprising the file and file checksums.
    
    


The following factors have hindered the scalability of the data de-duplication systems:

    
    
        a) ensuring integrity of the entire system; and
        b) distributing the metadata and data repositories across multiple instances or machines without compromising the integrity of the system.

Ensuring the Integrity of a Data De-Duplication System

    
    


An advantage of data de-duplication systems is that they need to store only one copy of each unique block of data. While storing one copy of each block yields storage efficiency, it can place several requirements on data de-duplication systems. The system may have to:

    
    
        a) ensure that the inter-relationship of files and the blocks that make up the file is accurate at all times;
        b) ensure that a block cannot be removed from the data de-duplication system while a file in the system is dependent on that block; and
        c) ensure the safety and integrity of the data of each block.
    
    


These conditions are desired because, if even a single block is inaccessible, the entire data de-duplication system may become unusable.
Additionally, the following operating environment constraints, in which most data de-duplication systems operate, should be considered:

    
    
        a) the data de-duplication system should be always online;
        b) the data de-duplication system should be able to manage billions of data blocks that are referenced by millions of files; and
        c) every day, millions of blocks could get added or deleted from the data de-duplication systems
    
    


Ensuring that a block of data is not referenced by any file in a live system can be a challenge. In a live system that is receiving information regarding thousands of blocks per second, a block's reference information can change at any given time.
Traditional Systems
Traditional systems handle this problem by adopting the following measures:

    
    
        a) Maintain reference counts for each block to keep track of the number of files that are referring to a given block. When a file is added to, or deleted from, the system, the system updates the reference counts for those blocks. This approach can cause several scalability and integrity issues:
        
            1. Every time a file gets added or deleted, the reference count must be updated in a metadata repository, requiring two repository operations: read the current value, and then write the new value. Additionally, if multiple threads are active in the system, synchronization overhead is required, which slows down the entire system.
            2. If the system crashes in the middle of a reference count update, integrity issues can arise. To protect against that, systems typically incur the overhead of database transactions, which further slow down the system.
            3. The overhead associated with reference count updates is incurred during the peak usage of the system, which further causes issues.
        
        
        b) Take the system offline to prevent any changes to the system, to validate the integrity of the system, and to find blocks that may be candidates for removal. Typically, after the system is taken offline, the entire metadata repository is traversed to ensure that inter-relationship of files, and the blocks that make up the files, is accurate for all files and blocks in the system. This can cause several scalability and availability problems:
        
            1. the system becomes unavailable periodically, thereby lowering business productivity; and
            2. as the size of the system grows, the amount of time the system must be down becomes larger and larger—effectively putting a limit on the maximum size of the data de-duplication system—determined by the time requirement of the system to be offline and the maximum downtime allowed by business objectives of the system.
        
        
    
    


Another problem with traditional systems is that while they can detect an integrity problem, they are typically unable to fix it by themselves. This inability can increase the cost of management of such systems if additional safeguards have to be built around those systems to help them recover from any integrity issues.
Traditional Method of Removing Unreferenced Blocks from Data De-Duplication System
Traditional data storage systems may organize the chunked digital data they store into several levels of hierarchical components, each of which represent and/or store different elements of the digital data.
FIG. 1 illustrates one such organization of a chunked representation of digital data. The organizing components include the following three structure types:
BlockCheckSum (“BCS”): each file is broken into one or more smaller blocks using one or more chunking approaches specific to the data de-duplication repository. A checksum is computed for each block. This checksum is referred to as a BlockCheckSum, and may be used to reference the block.
FileCheckSum (“FCS”): for each file a checksum is computed for the entire file. This FileCheckSum is stored with the backup catalog of each file. The FileCheckSum may be considered a type of file identifier that represents the file as it is stored in the repository.
BlockMap: each FileCheckSum has a block map which keeps track of the interrelationships between the file and the blocks it is comprised of.
Mapping a File to FileCheckSum and BlockCheckSum Components
Still referring to FIG. 1, every file in the catalog contains a pointer to the FileCheckSum representing the contents of that file. Each FileCheckSum can optionally have a reference count equal to number of files this checksum is being referenced by.
Each FileCheckSum as explained above has a BlockMap which contains the list of BlockCheckSums that comprise that particular FileCheckSum. Each BlockCheckSum maintains a reference count which is equal to the number of times it is being referenced inside all the BlockMaps.
The FileCheckSum is not deleted until the reference count associated with it is zero; i.e., there is no file is referring to it. Similarly a BlockCheckSum is not deleted until the reference count associated with it is zero; i.e., no FileCheckSum is referring to it.
A Highly Scalable, Reliable and Available Data De-Duplication System
A scalable, reliable, and available data de-duplication system is described, which can have the following attributes:

    
    
        a) performs highly reliable and efficient online integrity testing, ensuring that the system is not taken offline for regular integrity checks;
        b) does not need to maintain expensive and error-prone reference counts;
        c) is a self-healing system which can detect and address integrity issues on its own; and
        d) is highly scalable across multiple distributed machines without compromising integrity.

Online Integrity Testing without Maintaining Reference Counts

    
    


Embodiments that can identify unreferenced blocks, without relying on reference counts, are described here. One aspect of these embodiments include adding the following attributes to the metadata repository of a storage system:

    
    
        1. each FileCheckSum has an additional attribute: “LastFCSValidationTime”; and
        2. each BlockCheckSum has an additional attribute: “LastBlockExistCheckTime”.
    
    


Additionally, two block metadata storage containers are defined:

    
    
        1. The BlockCheckSums currently in use are kept in the “BlocksContainer”.
        2. A new container “RecycleBinForBlocks” which keeps all the
    
    


BlockCheckSums which the system determines are ready to be deleted.
Based on the above additional attributes and the new metadata storage containers, the following embodiments are used for identifying and then removing unreferenced blocks from the data de-duplication system. The embodiments below are designed to be:

    
    
        1) Online: run while the system is online
        2) Restartable: there is no requirement for these embodiments to complete the integrity check pass on the entire data set in a single run. They can start, then stop, and then restart, from the point where they left off without compromising the integrity of the data.
        3) Continuously running or be only running at scheduled intervals: these embodiments are designed to be running either continuously or only at scheduled intervals, say in non-peak hours. Because they are restartable, interrupting a run does not affect the system at all.
    
    


The embodiments consist of three primary processes, any combination of which may be running at a given time in a data storage system. One process concerns removing unreferenced blocks, and specifically unreferenced BlockCheckSums. A second process is associated with how to add new digital data to the storage system. This involves adding a new FileCheckSum while ensuring that any concurrently-running block removal process does not interfere with the addition of the blocks associated with the new FileCheckSum and vice versa. A third process, also runnable at any time with respect to the other two processes, is concerned with maintaining timestamps within the system to accommodate the needs of the block removal process and with maintaining referential integrity.
Method for Adding a New FileCheckSum


    
    
        1. Add the new FileCheckSum with “LastFCSValidationTime” as current time
        2. If the global state of “RemoveUnreferenceBlockInProgress” is true, then for each block in the BlockMap, update the “LastBlockExistCheckTime” to current time.
    
    


FIG. 4 provides more details on a method for adding a new file check sum.
Method for updating the block existence time


    
    
        1. Get the FileCheckSum entry with oldest “LastFCSValidationTime”
        2. Read the BlockMap of the FileCheckSum
        3. For each BlockCheckSum entry in the BlockMap, validate and update the “LastBlockExistCheckTime” to current time
        
            a. If the BlockCheckSum is not present in “BlocksContainer”, then move it back from “RecycleBinForBlocks” if present.
            b. If the BlockCheckSum is not present in the system and not present in the “RecycleBinForBlocks” container, then mark the FileCheckSum invalid.
        
        
        4. Update “LastFCSValidationTime” of the FileCheckSum to be the current time
        5. Keep repeat step 1 for the next FileCheckSum
    
    


FIG. 2 provides more details on the method for updating the block existence time during non peak hours.
Method for Removing Unreferenced Blocks


    
    
        1. Set global state of “RemoveUnreferenceBlockInProgress” to true
        2. Get the oldest “LastFCSValidationTime” from FileCheckSum (which will be referred to here as the “OldestLastFCSValidationTime”)
        3. Remove Unreferenced Blocks from “BlocksContainer”:
        
            a. Find all BlockCheckSums from “BlocksContainer” for which the value “LastBlockExistCheckTime” is earlier than “OldestLastFCSValidationTime”. This list is the list of all Blocks which are not referenced in any of the FileCheckSum (see method for adding a new FileCheckSum).
            b. For each such Block found, remove it from the “BlocksContainer” and add it to “RecycleBinForBlocks” with “LastBlockExistCheckTime” set to the current time.
        
        
        4. Remove Unreferenced Blocks from “RecycleBinForBlocks”:
        
            a. Find all BlockCheckSum from “RecycleBinForBlocks” which the value “LastBlockExistCheckTime” is earlier than “OldestLastFCSValidationTime”. This list is the list of all Blocks which are not referenced in any of the FileCheckSum (see method for adding a new FileCheckSum)
            b. For each Block found, remove it from the “RecycleBinForBlocks” and free its associated block data.
        
        
        5. Set global state of “RemoveUnreferenceBlockInProgress” to false
    
    


FIG. 3 provides more details on a method for removing unreferenced blocks during non-peak hours.
The above method of removing unreferenced blocks from the data de-duplication system has one or more of the following benefits:

    
    
        1. The entire data de-duplication system is not locked down for performing integrity testing before removing the unreferenced blocks.
        2. For most time (excluding time when remove unreferenced blocks in progress), adding a new file checksum does not require any updates of associated blocks, thus reducing the time to insert a new file.
        3. The process for removing unreferenced blocks can be done during non-peak hours without affecting the peak load.

Self-Healing System

    
    


Once a data de-duplication system has detected that there is an integrity issue, it should try to fix itself automatically. The following integrity issues are possible:

    
    
        a) The inter-relationship of one or more files, and the blocks that make up the file, becomes inaccurate in the metadata repository.
        b) One or more blocks get deleted from the data de-duplication system metadata repository, while one or more files in the system are still dependent on those blocks.
        c) The data for one or more blocks gets deleted from the system while the metadata repository still has files and blocks dependent on that data.
    
    


A highly reliable system should be able to detect the above issues and should have taken measures beforehand to ensure that it can fix these issues automatically.
Distributed Block Data and Metadata
A new system is described for intelligently distributing the metadata and block data for the centralized metadata and data repositories inherent in a data de-duplication system. The distribution is done by leveraging nodes of which one or more of them are already expected to be present in the system:

    
    
        a) Cache node metadata and block data repositories: several storage and backup systems create cache servers at remote sites to enable faster access to the data by not requiring WAN access for every data request. A remote cache server associated with the data de-duplication system hosts a cache that has metadata and block data repositories for faster access.
        b) Single client metadata and block data repositories: clients accessing or storing data on the data de-duplication system can many times store local copies of metadata and block data repositories specific to their computer.
        c) High availability node metadata and block data repositories: a high availability system can store either all or a subset of metadata and block data repository on the data de-duplication system.
        d) Disaster recovery node metadata and block data repositories: a disaster recovery copy of the data de-duplication system can store either all or a subset of metadata and block data repository on the data de-duplication system.
    
    


A reliable and self-healing system can influence and leverage these distributed copies of metadata and block data repositories to ensure that multiple copies of the metadata and data associated with each file, FileCheckSum, and BlockCheckSum are available in a system at a given time. The key attributes are:

    
    
        a) The system keeps track of how many copies are available for each metadata and data associated with each file, FileCheckSum, and BlockCheckSum.
        b) The system keeps track of the importance of each metadata and data associated with each file, FileCheckSum, and BlockCheckSum based on a scorecard that is generated by using several factors like: number of times a block is referred, number of times a file has been referred.
        c) The system also assigns a quality of access scorecard to each source based on the link speed, availability of the source, etc.
    
    


The data de-duplication system can be implemented in hardware and/or software, including a special purpose processor, general purpose processor, or combination thereof. The processor can execute software programs stored in computer readable media and executed by a processor. The system for maintaining data can include one or more databases, and/or other suitable memory, including optical, magnetic, or solid state.
Although the present disclosure has been described and illustrated in the foregoing example embodiments, it is understood that the present disclosure has been made only by way of example, and that numerous changes in the details of implementation of the disclosure may be made without departing from the spirit and scope of the disclosure, which is limited only by the claims which follow. Other embodiments are within the following claims. For example, the described methods for removing unreferenced blocks could be implemented in data storage systems such as generalized databases in addition to backup systems, or within systems storing digital data in forms other than as files.

## Claims

1. A method of maintaining data blocks in a data storage system, the method comprising:
maintaining a plurality of data blocks in the data storage system;
representing a plurality of data files by associating each file identifier of a plurality of file identifiers with at least one of the plurality of data blocks;
maintaining a first set of timestamps, each data block in the plurality of data blocks being associated with one of the first set of timestamps, each of the first set of timestamps indicating a time when a respective data block was verified to have been associated with at least one of the plurality of file identifiers;
maintaining a second set of timestamps, different than the first set of timestamps, each file identifier of the plurality of file identifiers being associated with one of the second set of timestamps, each of the second set of timestamps indicating a time when a respective file identifier was verified to have been associated with at least one of the plurality of data blocks; and
deleting a given data block when timestamp of the first set of timestamps associated with the given data block indicates an earlier time than each of the second set of timestamps.

2. The method of claim 1, further comprising: providing an indication that the given data block has been removed from the data storage system.

3. The method of claim 1, further comprising:
representing a new data file by associating a new file identifier with a new data block;
determining if the new data block corresponds to any of the plurality of existing data blocks;
storing the new data block in the data storage system if the new data block does not correspond to any of the plurality of data blocks; and
setting a new timestamp of the first set of timestamps to a current time for the new data block.

4. The method of claim 1, further comprising:
identifying a given file identifier with an earliest timestamp of the second set of timestamps;
verifying an association between the given file identifier and each of the plurality of data blocks associated with the given file identifier;
setting a timestamp of the first set of timestamps associated with each of the plurality of data blocks associated with the given file identifier to a current time; and
setting a timestamp of the second timestamps associated with the given file identifier to the current time.

5. The method of claim 4, wherein the data storage system comprises a first storage area and a second storage area, and wherein verifying the association between the given file identifier and each of the plurality of data blocks associated with the given file identifier further comprises:
determining if another given data block associated with the given file identifier is maintained in the first storage area or the second storage area;
moving the other given data block associated with the given file identifier from the second storage area to the first storage area if the other given data block is in the second storage area; and
marking the file identifier invalid if the other given data block is not maintained in the first storage area or the second storage area.

6. The method of claim 1, wherein the data storage system comprises a first storage area and a second storage area, and wherein deleting the given data block further comprises:
moving the given data block from the first storage area to the second storage area; and
setting the timestamp of the first set of timestamps associated with the given data block to a current time.

7. The method of claim 6, further comprising:
determining an earliest timestamp of the second set of timestamps; and
for each data block in the second storage area:
deleting the given data block in the second storage area if the timestamp of the first set of timestamps associated with the given data block is earlier than the determined earliest timestamp of the second set of timestamps.

8. The method of claim 1, wherein associating each file identifier of the plurality of file identifiers with at least one of the plurality of data blocks further comprises:
maintaining a block map for a given file identifier,
wherein the block map identifies the relationship between the given file identifier and each data block in the plurality of data blocks associated with the given file identifier.

9. The method of claim 1 wherein at least one of the plurality of data blocks is associated with two or more file identifiers of the plurality of file identifiers.

10. A data storage system configured for maintaining data blocks, comprising:
a data store comprising software; and
a processor in data communication with the data store and configured to execute the software in order to cause the data storage system to:
maintain a plurality of data blocks;
represent a plurality of data files by associating each file identifier of a plurality of file identifiers with at least one of the plurality of data blocks;
maintain a first set of timestamps, each data block in the plurality of data blocks being associated with one of the first set of timestamps, each of the first set of timestamps indicating a time when a respective data block was verified to have been associated with at least one of the plurality of file identifiers;
maintain a second set of timestamps, different than the first set of timestamps, each file identifier of the plurality of file identifiers being associated with one of the second set of timestamps, each of the second set of timestamps indicating a time when a respective file identifier was verified to have been associated with at least one of the plurality of data blocks; and
delete a given data block when a timestamp of the first set of timestamps associated with the given data block indicates an earlier time than each of the second set of timestamps.

11. The data storage system of claim 10, wherein the processor is further configured to cause the data storage system to: provide an indication that the given data block has been removed from the storage system.

12. The data storage system of claim 10, wherein the processor is further configured to cause the data storage system to:
represent a new data file by associating a new file identifier with a new data block;
determine if the new data block corresponds to any of the plurality of existing data blocks;
store the new data block in the data storage system if the new data block does not correspond to any of the plurality of data blocks; and
set a new timestamp of the first set of timestamps to a current time for the new data block.

13. The data storage system of claim 10, wherein the processor is further configured to cause the data storage system to:
identify a given file identifier with an earliest timestamp of the second set of timestamps;
verify an association between the given file identifier and each of the plurality of data blocks associated with the given file identifier;
set timestamps of the first set of timestamps associated with each of the plurality of data blocks associated with the given file identifier to a current time; and
set a timestamp of the second set of timestamps associated with the given file identifier to the current time.

14. The data storage system of claim 13, further comprising:
a first storage area and a second storage area, and
wherein to verify the association between the given file identifier and each of the plurality of data blocks associated with the given file identifier further comprises to:
determine if another given data block associated with the given file identifier is maintained in the first storage area or the second storage area;
move the other given data block associated with the given file identifier from the second storage area to the first storage area if the other given data block is in the second storage area; and
mark the file identifier invalid if the other given data block is not maintained in the first storage area or the second storage area.

15. The data storage system of claim 10, further comprising:
a first storage area and a second storage area, and
wherein to delete the given data block further comprises to:
move the given data block from the first storage area to the second storage area; and
set the timestamp of the first set of timestamps associated with the given data block to the current time.

16. The data storage system of claim 15, wherein the processor is further configured to cause the data storage system to:
determine an earliest timestamp of the second set of timestamps; and
for each data block in the second storage area:
delete the given data block in the second storage area if the timestamp of the first set of timestamps associated with the given data block is earlier than the determined earliest timestamp of the second set of timestamps.

17. The data storage system of claim 10, wherein associating each file identifier of the plurality of file identifiers with at least one of the plurality of data blocks further comprises:
maintaining a block map for a given file identifier,
wherein the block map identifies the relationship between the given file identifier and each data block in the plurality of data blocks associated with the given file identifier.

18. A non-transitory, computer-readable medium comprising computer-executable instructions that, when executed by a processor, cause a computing device to perform a method, the method comprising:
maintaining a plurality of data blocks in a data storage system;
representing a plurality of data files by associating each file identifier of a plurality of file identifiers with at least one of the plurality of data blocks;
maintaining a first set of timestamps, each data block in the plurality of data blocks being associated with one of the first set of timestamps, each of the first set of timestamps indicating a time when a respective data block was verified to have been associated with at least one of the plurality of file identifiers;
maintaining a second set of timestamps, different than the first set of timestamps, each file identifier of the plurality of file identifiers being associated with one of the second set of timestamps, each of the second set of timestamps indicating a time when a respective file identifier was verified to have been associated with at least one of the plurality of data blocks; and
deleting a given data block when a timestamp of the first set of time stamps associated with the given data block indicates an earlier time than each of the second set of timestamps.

19. The non-transitory, computer-readable medium of claim 18, wherein the method further comprises: providing an indication that the given data block has been removed from the data storage system.

20. The non-transitory, computer-readable medium of claim 18, wherein the method further comprises:
representing a new data file by associating a new file identifier with a new data block;
determining if the new data block corresponds to any of the plurality of data blocks;
storing the new data block in the data storage system if the new data block does not correspond to any of the plurality of data blocks; and
setting a new timestamp of the first set of time stamps to a current time for the new data block.

21. The non-transitory, computer-readable medium of claim 18, wherein the method further comprises:
identifying a given file identifier with an earliest timestamp of the second set of timestamps;
verifying an association between the given file identifier and each of the plurality of data blocks associated with the given file identifier;
setting a timestamps of the first set of timestamps associated with each of the plurality of data blocks associated with the given file identifier to a current time; and
setting a timestamp of the second set of timestamps associated with the given file identifier to the current time.

22. The non-transitory, computer-readable medium of claim 21, wherein the data storage system comprises a first storage area and a second storage area, and wherein verifying the association between the given file identifier and each of the plurality of data blocks associated with the given file identifier further comprises:
determining if another given data block associated with the given file identifier is maintained in the first storage area or the second storage area;
moving the other given data block associated with the given file identifier from the second storage area to the first storage area if the other given data block is in the second storage area; and
marking the file identifier invalid if the other given data block is not maintained in the first storage area or the second storage area.

23. The non-transitory, computer-readable medium of claim 18, wherein the data storage system comprises a first storage area and a second storage area, and wherein deleting the given data block further comprises:
moving the given data block from the first storage area to the second storage area; and
setting the timestamp of the first set of timestamps associated with the given data block to a current time.

24. The non-transitory, computer-readable medium of claim 23, wherein the method further comprises:
determining an earliest timestamp of the second set of timestamps; and
for each data block in the second storage area:
deleting the given data block in the second storage area if the timestamp of the first set of timestamps associated with the given data block is earlier than the determined earliest timestamp of the second set of timestamps.

25. The non-transitory, computer-readable medium of claim 18, wherein associating each file identifier of the plurality of file identifiers with at least one of the plurality of data blocks further comprises:
maintaining a block map for a given file identifier,
wherein the block map identifies the relationship between the given file identifier and each data block in the plurality of data blocks associated with the given file identifier.