# Difference between delete.retention.ms and retention.ms

**URL:** <https://forum.confluent.io/t/difference-between-delete-retention-ms-and-retention-ms/10613>\
**Category:** Clients\
**Created:** [3 May 2024 07:27 UTC](https://forum.confluent.io/t/difference-between-delete-retention-ms-and-retention-ms/10613 "2024-05-03T07:27:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidbailo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/davidbailo/32/3742_2.png) [@davidbailo](https://forum.confluent.io/u/davidbailo)\
**Post date:** [3 May 2024 07:27 UTC](https://forum.confluent.io/t/difference-between-delete-retention-ms-and-retention-ms/10613/1 "2024-05-03T07:27:55Z")

</div>

Hello!  
I’m seeing ambiguous information on the actual meaning of these two topic properties.  
Which is responsible for the actual retention time in a topic, i.e. for how long the messages are stored?  
Thank you,  
David

---

<div class="post-metadata">

**Author:** ![dtroiano](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/dtroiano/32/1961_2.png) [@dtroiano](https://forum.confluent.io/u/dtroiano)\
**Post date:** [3 May 2024 14:07 UTC](https://forum.confluent.io/t/difference-between-delete-retention-ms-and-retention-ms/10613/2 "2024-05-03T14:07:26Z")

</div>

The `delete.retention.ms` property dictates how long to retain tombstones (special messages with null value signifying deletion) in [compacted](https://docs.confluent.io/kafka/design/log_compaction.html) topics, while `retention.ms` dictates how long to retain “regular” (non-tombstone) messages in topics that have the `delete` `cleanup.policy` set.

The topic’s [`cleanup.policy`](https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#cleanup-policy) dictates which property applies:

- `cleanup.policy` = `delete`: only `retention.ms` applies
- `cleanup.policy` = `compact`: only `delete.retention.ms` applies
- `cleanup.policy` = `delete,compact`: both `retention.ms` and `delete.retention.ms` apply

---

<div class="post-metadata">

**Author:** ![davidbailo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/davidbailo/32/3742_2.png) [@davidbailo](https://forum.confluent.io/u/davidbailo)\
**Post date:** [3 May 2024 14:42 UTC](https://forum.confluent.io/t/difference-between-delete-retention-ms-and-retention-ms/10613/3 "2024-05-03T14:42:11Z")

</div>

Understood, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [10 February 2025 21:23 UTC](https://forum.confluent.io/t/difference-between-delete-retention-ms-and-retention-ms/10613/4 "2025-02-10T21:23:08Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
