# Deduplication and different compression types

**URL:** <https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999>\
**Category:** Support\
**Created:** [May 1, 2023, 6:14pm UTC](https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999 "2023-05-01T18:14:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nixcamic](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/nixcamic/32/479_2.png) [@nixcamic](https://kopia.discourse.group/u/nixcamic)\
**Post date:** [May 1, 2023, 6:14pm UTC](https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999/1 "2023-05-01T18:14:26Z")

</div>

If I have two different policies with different compression types, and have the same file in both, will it still be deduplicated? Which compression will get applied to it?

---

<div class="post-metadata">

**Author:** ![nixcamic](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/nixcamic/32/479_2.png) [@nixcamic](https://kopia.discourse.group/u/nixcamic)\
**Post date:** [May 4, 2023, 1:31am UTC](https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999/2 "2023-05-04T01:31:18Z")

</div>

Is there a better place to ask this sort of question?

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [May 4, 2023, 4:47pm UTC](https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999/3 "2023-05-04T16:47:33Z")

</div>

Since this is content-addressable storage, my guess would be that this file would only be compressed once, since it is looked up by the hash of its contents - regardless of its compression.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [May 6, 2023, 12:59pm UTC](https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999/4 "2023-05-06T12:59:48Z")

</div>

the easiest would be to test. create local kopia repo and backup one folder. Check repo size. Backup again another folder but with the same content as initial one and different compression policy. Check repo size.

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [May 6, 2023, 2:34pm UTC](https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999/5 "2023-05-06T14:34:23Z")

</div>

Well, unless the data in question would heavily benefit from particular compression algorithm over the other, this is more of an academic excercise anyway - at least from my point of view.

If I’d design kopia’s algorithms, I would rather keep as much of the work on the repo away, since files are usually put into packs and re-compressing only one of thesr files would result in quite some extra work for no or at least little benefit.

Just my 2c, of course.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [May 6, 2023, 2:36pm UTC](https://kopia.discourse.group/t/deduplication-and-different-compression-types/1999/6 "2023-05-06T14:36:17Z")

</div>

agree it is academic sort of.

But if somebody wants to know answer either check code or test or both:) Anything else are just assumptions that might be right or wrong.
