What is File Deduplication?
File deduplication identifies repeated file content so that a system can avoid storing or processing identical data unnecessarily. Exact-byte deduplication is different from deciding whether two images or recordings are perceptually similar.
How File Deduplication works
A system hashes an incoming file and compares the result with hashes of stored files. A match identifies a possible duplicate for any further verification the application requires. The application can then reuse stored bytes or skip repeated processing while keeping each user’s file record and permissions. When caching processed outputs, include the transformation settings and relevant tool version in the cache key: a square crop and a full-width preview of the same source are different outputs.
Key facts
- Matching filenames or URLs do not establish matching content. Conversely, changing only embedded metadata changes file bytes even if an image still looks the same.
- A partial-file hash can leave bytes unchecked. The algorithm matters too: practical collisions exist for MD5 and SHA-1, so an attacker can produce different files with matching hashes. Use a collision-resistant algorithm when a match decides whether stored bytes are reused for a new upload.
- Do not reveal another user’s file or bypass their authorization because a digest matches. Reuse must preserve access boundaries.
When File Deduplication matters
Hash the whole file with a collision-resistant algorithm such as SHA-256 to find exact duplicates. Keep ownership and permissions separate: two users can upload the same bytes without sharing access to each other’s files.
How Transloadit helps with File Deduplication
Transloadit’s /file/hash Robot uses SHA-256 by default. Use full-file hashing when examining all source bytes matters.
Partial modes hash only the first N bytes, only the last N bytes, or the first N bytes concatenated with the last N bytes; partial_size sets N. Bytes outside the selected regions remain unchecked.